Re: LWP::Parallel Features
Gisle Aas (gisle@aas.no)
01 Sep 1999 10:42:24 +0200
Marc Langheinrich <marclang@cs.washington.edu> writes:
> Currently, PUA uses a much simpler mechansim: Wait for <timeout> seconds
> for incoming data. If some is available, read it and start again waiting
> for <timeout> seconds, and so on. If PUA was waiting for <timeout> seconds
> and _no_ data is available for reading on _any_ connection, set _all_
> current connections to "timed out" and start processing the next set of
> requests.
>
> I could see that the "check all open connections after every read" approach
> would allow PUA to detect unresponsive connections much sooner and already
> close them to make room for new connections, resulting in a faster overall
> scan if you have lots of unresponsive sites. However, this would require
> lots of more bookkeeping for each request, and a higher overhead during
> reading (since we have to loop continously over all requests).
>
> Do people need this kind of behavior?
For LWPng I implemented individual timeouts by having an EventLoop that
by itself handled separate timeouts for each "channel" (take a look at
LWP::EventLoop). A similar interface is also available for the newer
Event.pm event-loop.
Regards,
Gisle