added a wait flag to create_events_for_hook() to allow for processing large sets...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 28 May 2010 19:37:32 +0000 (19:37 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 28 May 2010 19:37:32 +0000 (19:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16532 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm

index d9165f8..a2a9542 100644 (file)
@@ -1667,9 +1667,12 @@ sub fire_object_event {
 
 
 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 {