Jack Tang
2009-Mar-15 05:42 UTC
[Eventmachine-talk] How can I add TimeoutHandler to EvenmentMachine
Hi, list Now I am coding for one non-blocking httpclient based on event-machine, and it seems the client will hang for 50 seconds if the destination is unreachable. My questions are 1. How can I short the timeout? I had tried conn.set_comm_inactivity_timeout(5), but it didn''t work 2. How can I add TimeoutHandler to the connection? Thanks! /Jack -- Jack Tang Software Engineer at Vobile Email: himars at gmail.com http://www.linkedin.com/in/jacktang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090315/eabc1a0b/attachment.html>
On 15 Mar 2009, at 09:42, Jack Tang wrote:> Hi, list > > Now I am coding for one non-blocking httpclient based on event- > machine, and it seems the client will hang for 50 seconds if the > destination is unreachable. >This long time was introduced by the following changeset: http://github.com/eventmachine/eventmachine/commit/3823433104029d75d1b086942b48372ea421da0f The reasoning for both timelines are good, in reality, we need to stop this from blocking, however, that is quite a change too.> My questions are > > How can I short the timeout? I had tried > conn.set_comm_inactivity_timeout(5), but it didn''t work > How can I add TimeoutHandler to the connection? > Thanks! > > /Jack > > > > -- > Jack Tang > Software Engineer at Vobile > > Email: himars at gmail.com > http://www.linkedin.com/in/jacktang > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090315/5defb7c6/attachment.html>
Thanks, James. I had solved my issues by add #timeout_with_block method to Deferrable module. It works fine now. /Jack On Sun, Mar 15, 2009 at 9:27 PM, James Tucker <jftucker at gmail.com> wrote:> > On 15 Mar 2009, at 09:42, Jack Tang wrote: > > Hi, list > > Now I am coding for one non-blocking httpclient based on event-machine, and > it seems the client will hang for 50 seconds if the destination is > unreachable. > > This long time was introduced by the following changeset: > > > http://github.com/eventmachine/eventmachine/commit/3823433104029d75d1b086942b48372ea421da0f > > The reasoning for both timelines are good, in reality, we need to stop this > from blocking, however, that is quite a change too. > > My questions are > > 1. How can I short the timeout? I had tried > conn.set_comm_inactivity_timeout(5), but it didn''t work > 2. How can I add TimeoutHandler to the connection? > > Thanks! > > /Jack > > > -- > Jack Tang > Software Engineer at Vobile > > Email: himars at gmail.com > http://www.linkedin.com/in/jacktang > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-- Jack Tang Software Engineer at Vobile Email: himars at gmail.com http://www.linkedin.com/in/jacktang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090316/8cd6159b/attachment-0001.html>