camelobserver has asked for the wisdom of the Perl Monks concerning the following question:
I'm making an API request to another server and trying to enforce a hard timeout so I don't stall if the server isn't responsive, or trickles a response back. The timeout I want to use is very short (250ms).
Is it possible to combine LWP::UserAgent with an alarm call to force a timeout? I've tried this but w/o success.
I've also looked at LWPx::ParanoidAgent but in my tests with that I was still able to get a request that took twice as long as my timeout.
I'm hoping Monks can point me in the right direction, surely someone here has run into a similar problem and found the right solution for handling it.
Thanks in advance,
One humble camelobserver
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hard timeout for LWP::UserAgent or similar
by davido (Cardinal) on Mar 30, 2011 at 17:06 UTC | |
by Anonymous Monk on Mar 31, 2011 at 01:03 UTC | |
|
Re: Hard timeout for LWP::UserAgent or similar
by Eliya (Vicar) on Mar 30, 2011 at 18:25 UTC | |
|
Re: Hard timeout for LWP::UserAgent or similar
by BrowserUk (Patriarch) on Mar 30, 2011 at 17:19 UTC | |
by camelobserver (Initiate) on Mar 30, 2011 at 17:59 UTC | |
by BrowserUk (Patriarch) on Mar 31, 2011 at 01:45 UTC |