Hi! I've just subscribed to this list. I've been trying POE
and also needed a POE'd LWP. I've written a module I called
POE::Component::UserAgent, although maybe I should rename it
to POE::Component::Client::UserAgent.

Like PoCo::Client::HTTP, it allows other sessions run while
HTTP transactions are being processed, and lets several HTTP
transactions be processed in parallel. Because it is derived
from LWP::Parallel::UserAgent, which in turn derives from
LWP::UserAgent, it gives the ability to use protocols other
than HTTP, currently FTP and HTTPS, as well as other LWP
niceties like proxying and automatic redirect and
authentication processing. It also inherits request queue
management from LWP::PUA.

It doesn't use any POE weels, but it tries to block as little
as possible. Currently it blocks when connecting to a server,
but I've written a patch to LWP::Parallel::Protocol::http for
non-blocking connect, and the author will be considering it
for the next version of LWP::Parallel. When that is included,
the component will block only when resolving a host name.

Would there be interest in having a POE component like that?

The module appears to work already, so anyone is welcome to
test it. I don't know if it will compile with Perls prior to
5.6, there are some minor differences in syntax, but they
would be very easy to fix.

At http://www.en-directo.net/poe/ I've put the module, a
couple of test scripts, and the patched http.pm. No docs yet,
sorry. Test scripts are quite self explanatory, though.

Kirill


> I see the Filter::HTTPD and I am thinking about doing the same thing for a 
> client; I want to be able to fire off web requests and wait for the results 
> asynchronously.  I could use LWP::Parallel except that I have non-HTTP 
> things to process at the same time, which will be POE sessions.
> 
> So I am toying with the idea of constructing a POE Component which would be 
> a LWP::UserAgent that would accept HTTP::Requests and trigger events upon 
> receipt of an HTTP::Response.  Does this make sense or am I barking up the 
> wrong tree?  Am wondering how hard this will be to construct - I would like 
> to delegate as much as possible to LWP.
> --
> Peter Scott
> Pacific Systems Design Technologies

Reply via email to