[open-ils-commits] r16532 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri May 28 15:37:37 EDT 2010


Author: erickson
Date: 2010-05-28 15:37:32 -0400 (Fri, 28 May 2010)
New Revision: 16532

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
added a wait flag to create_events_for_hook() to allow for processing large sets of objects without dropping all the calls on the network at once

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2010-05-28 16:40:39 UTC (rev 16531)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2010-05-28 19:37:32 UTC (rev 16532)
@@ -1667,9 +1667,12 @@
 
 
 sub create_events_for_hook {
-    my($self, $hook, $obj, $org_id) = @_;
+    my($self, $hook, $obj, $org_id, $wait) = @_;
     my $ses = OpenSRF::AppSession->create('open-ils.trigger');
-    $ses->request('open-ils.trigger.event.autocreate', $hook, $obj, $org_id);
+    my $req = $ses->request('open-ils.trigger.event.autocreate', $hook, $obj, $org_id);
+    return undef unless $wait;
+    my $resp = $req->recv;
+    return $resp->content if $resp;
 }
 
 sub create_uuid_string {



More information about the open-ils-commits mailing list