Re: Multiple LWP::UserAgents at the same time
Hinrik Örn Sigurðsson <[email protected]> Thu, 21 Jun 2012 12:26:17 +0000
| Newsgroups | gmane.comp.lang.perl.poe |
|---|---|
| Message-ID | <CAA1iZceTb37bWUERbpw7KfxN7j6ryOEefCcWHac=4HrRrBpjpA@mail.gmail.com> |
On Tue, Apr 3, 2012 at 10:18 PM, Nick Perez <[email protected]> wrote: > At first glance without reading the documentation to this module, I > would say that this is wrong. Fetching the $url should be a > non-blocking action that you give it a postback (or configured > session/event to post) to notify you when a response is ready for > reading. There is a proper HTTP client for POE that gives you this > ability (albeit with a bit more verbosity). Take a look at > POE::Component::Client::HTTP and see if it better fits the bill for > what you need. Gabor's usage is correct. The "POE" part in LWP::UserAgent::POE comes from the fact that $ua->get() actually calls $poe_kernel->run_one_timeslice() while waiting for data, allowing other POE events to be processed in the meantime.