py_201 has asked for the wisdom of the Perl Monks concerning the following question:
Currently the caller script waits for all child processes to exit and then return from web service process and it resumes execution from next line to eval statement and display results. But i want to display the results as soon as i get any from any forked process(incremental results) i.e my script shud not wait for all processes to finish up. but shud display results as they come up.eval { $results = SOAP::Lite -> uri(method) -> proxy("script2.pl", timeout => 15) -> parallel_search($serialized_searches) -> result; }; sub parallel_search { foreach my $key (keys %$searches) { my $pid = $pm->start($key) and next; --- --- $pm->finish; } $pm->wait_all_children; return($result_set); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Incremental results using Parallel Processing
by Corion (Patriarch) on Mar 24, 2009 at 07:50 UTC |