develooper Front page | perl.poe | Postings from April 2012

Re: Multiple LWP::UserAgents at the same time

Thread Previous | Thread Next
From:
Nick Perez
Date:
April 3, 2012 15:21
Subject:
Re: Multiple LWP::UserAgents at the same time
Message ID:
20120404001825.4c4db8a0@nicklaptop.home.nickandperla.net
On Tue, 3 Apr 2012 16:57:59 +0300
Gabor Szabo <gabor@szabgab.com> wrote:

> 		my $ua = LWP::UserAgent::POE->new(timeout => 10);
> 		my $response = $ua->get($url) ;


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.



-- 

Nicholas Perez
XMPP/Email: nick@nickandperla.net
https://metacpan.org/author/NPEREZ
http://github.com/nperez

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About