I'm sure you're aware of the LWP::UserAgent timeout() method, but its granularity is in seconds, not milliseconds. Plus, it has a rather telling description of the timeout() function:
$ua->timeout( $secs )
Get/set the timeout value in seconds. The default timeout() value is 180 seconds, i.e. 3 minutes.
The requests is aborted if no activity on the connection to the server is observed for timeout seconds. This means that the time it takes for the complete transaction and the request() method to actually return might be longer.
As it says, the time it takes might be longer than the actual timeout setting.
LWPx::ParanoidAgent's documentation doesn't discuss finer granularity than 'seconds' either. So I don't see that as getting you any closer to your 250ms turnaround.
There is an interesting module: LWP::Parallel::UserAgent. At first when I looked at it I was thinking of your problem in terms of attacking it in parallel so that it isn't as important that any single thread takes longer than you wanted. But as I was reading over the module, I discovered that it supports a non-blocking mode, which can be set with the $ua->nonblock( $ok ) method. A non-blocking approach with a callback might be so much nicer than trying to constrain your timeouts to 250ms. You may want to have a look at that technique.
Dave
In reply to Re: Hard timeout for LWP::UserAgent or similar
by davido
in thread Hard timeout for LWP::UserAgent or similar
by camelobserver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |