LP#1724029 Patron search API returns correct order
authorBill Erickson <berickxx@gmail.com>
Fri, 10 Aug 2018 16:16:57 +0000 (12:16 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 22 Aug 2018 15:08:48 +0000 (11:08 -0400)
Avoid use of max_chunk_size in patron search API as it results in
streaming responses in the wrong order.  Use max_bundle_count instead,
which does not suffer from the sorting issues.  What's more, its purpose
and affect is easier to grasp in the code.

Bundle count is set to 5 so the API will begin returning results at most
5 patrons into the data fleshing process.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm

index f0bfa2e..662241c 100644 (file)
@@ -1323,16 +1323,8 @@ __PACKAGE__->register_method(
     method   => "patron_adv_search",
     api_name => "open-ils.actor.patron.search.advanced.fleshed",
     stream => 1,
-    # TODO: change when opensrf 'bundling' is merged.
-    # set a relatively small bundle size so the caller can start
-    # seeing results fairly quickly
-    max_chunk_size => 4096, # bundling
-
-    # api_level => 2,
-    # pending opensrf work -- also, not sure if needed since we're not
-    # actaully creating an alternate vesrion, only offering to return a
-    # different format.
-    #
+    # Flush the response stream at most 5 patrons in for UI responsiveness.
+    max_bundle_count => 5,
     signature => {
         desc => q/Returns a stream of fleshed user objects instead of
             a pile of identifiers/