From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Thu, 11 Mar 2010 23:38:31 +0000 (+0000) Subject: added option to discard streaming results X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=27c78c4743f5e394e64d87523eb0319d8984633d;p=evergreen%2Ftadl.git added option to discard streaming results git-svn-id: svn://svn.open-ils.org/ILS/trunk@15812 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm index 11a5e7560f..66345b0dfc 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm @@ -361,7 +361,7 @@ sub request { $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,6 +391,16 @@ sub substream { 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 @@ sub runmethod { $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 @@ sub json_query { $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;