From c077a750ee058751cd11af2e754f063cb83b189c Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 9 Nov 2010 01:57:38 +0000 Subject: [PATCH] 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 --- src/perl/lib/OpenSRF/Application/Demo/SimpleText.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.43.2