From: dbs Date: Tue, 9 Nov 2010 01:57:38 +0000 (+0000) Subject: Add a streaming version of the split() method in simpletext example X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c077a750ee058751cd11af2e754f063cb83b189c;p=opensrf%2Fbjwebb.git Add a streaming version of the split() method in simpletext example git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@2057 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perl/lib/OpenSRF/Application/Demo/SimpleText.pm b/src/perl/lib/OpenSRF/Application/Demo/SimpleText.pm index b5d09c3..9085e9b 100644 --- a/src/perl/lib/OpenSRF/Application/Demo/SimpleText.pm +++ b/src/perl/lib/OpenSRF/Application/Demo/SimpleText.pm @@ -140,7 +140,9 @@ sub text_split { my $delimiter = shift || ' '; my @split_text = split $delimiter, $text; - return \@split_text; + foreach my $string (@split_text) { + $conn->respond( $string ); + } return undef; } @@ -150,6 +152,7 @@ __PACKAGE__->register_method( api_name => 'opensrf.simple-text.split', api_level => 1, argc => 2, + stream => 1, signature => { desc => <<" DESC", Splits a string by a given delimiter (space by default) and returns an array of the split strings