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.


In reply to POE's queue and Wheel::ReadWrite->put() by Coruscate

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.