How to get rid of the delay after the real work is done?

Michael Lackhoff <[email protected]>
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
I am totally new to POE, so this might be a silly question but I looked
at the mailing list archive and the FAQ and didn't find the answer.

What I want to do is a parallel web client. For this I found a good
recipe in the POE cookbook http://poe.perl.org/?POE_Cookbook/Web_Client
The first example looked exactly like what I was looking for so I copied
the code and only added a few more URLs to @url_list.
Everything went fine, I got the web pages very fast but then after the
real work was done (all pages displayed) I had to wait for another 5
seconds until the script ended.
When I did this with the real pages I want to get (some JSON results)
and a bit of Time::HiRes output the relation was 4 seconds for the
actual work and then the 5 seconds delay until I could proceed.
If I could speed this up to the 4 seconds needed for the actual work,
everything would be fine and so much better than 9 seconds. How can I
achieve this?

Eventually I want to wrap this script into a method of my application,
call it with a list of URLs and return the combined result. The
application is a mod_perl web app. Are there any issues with this setup
I should watch out for?

Thanks
-Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.