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

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 11 18:38:37 EST 2010


Author: erickson
Date: 2010-03-11 18:38:31 -0500 (Thu, 11 Mar 2010)
New Revision: 15812

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
Log:
added option to discard streaming results

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm	2010-03-11 22:13:58 UTC (rev 15811)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm	2010-03-11 23:38:31 UTC (rev 15812)
@@ -361,7 +361,7 @@
             $self->log(D,"running in substream mode");
             $val = [];
             while( my $resp = $req->recv(timeout => $self->timeout) ) {
-                push(@$val, $resp->content) if $resp->content;
+                push(@$val, $resp->content) if $resp->content and not $self->discard;
             }
 
         } else {
@@ -391,7 +391,17 @@
    return $self->{substream};
 }
 
+# -----------------------------------------------------------------------------
+# discard response data instead of returning it to the caller.  currently only 
+# works in conjunction with substream mode.  
+# -----------------------------------------------------------------------------
+sub discard {
+   my( $self, $bool ) = @_;
+   $self->{discard} = $bool if defined $bool;
+   return $self->{discard};
+}
 
+
 # -----------------------------------------------------------------------------
 # Sets / Returns the requestor object.  This is set when checkauth succeeds.
 # -----------------------------------------------------------------------------
@@ -661,6 +671,7 @@
 
     $method =~ s/\.atomic$//o if $self->substream($$options{substream} || 0);
     $self->timeout($$options{timeout});
+    $self->discard($$options{discard});
 
 	# remove any stale events
 	$self->clear_event;
@@ -791,6 +802,7 @@
     $method =~ s/\.atomic$//o if $self->substream($$options{substream} || 0);
 
     $self->timeout($$options{timeout});
+    $self->discard($$options{discard});
 	$self->clear_event;
     my $obj;
     my $err;



More information about the open-ils-commits mailing list