Coruscate has asked for the wisdom of the Perl Monks concerning the following question:
As of yet, this is my first gripe with POE (or more specifically, POE::Wheel::ReadWrite (not sure which is to blame). Within the server, I need to grab pages from the net. Some of these pages may take quite a number of seconds to retrieve, so I wish to let the user know that it is grabbing the page and that it might take a few seconds. So I programmed the following lines of code, thinking it might just DWIM:
$heap->{wheel}->put("Grabbing webpage. May take a moment..."); my $ua = new LWP::UserAgent; my $html = $ua->get($url_to_retrieve);
But of course not! It would make things way too easy for put() to _immediately_ send out the message. So of course, put() places the message in a queue and unfortunately for me, it's not sent out until after the webpage retrieval is complete. Definitely not what I wanted to happen.
I've tried playing with POE::Kernel's delay(), yield() and call() methods, with no working results. If anyone happens to know of some code to help me (or better yet, point me to some docs that I overlooked) I'd be very happy :)
If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: POE's queue and Wheel::ReadWrite->put()
by Matts (Deacon) on Jul 16, 2003 at 22:32 UTC | |
|
Re: POE's queue and Wheel::ReadWrite->put()
by PodMaster (Abbot) on Jul 16, 2003 at 21:15 UTC |