# Handling closed and broken connection

**URL:** <https://www.ruby-forum.com/t/handling-closed-and-broken-connection/196315>\
**Category:** NGINX\
**Created:** [October 11, 2010, 3:30pm UTC](https://www.ruby-forum.com/t/handling-closed-and-broken-connection/196315 "2010-10-11T15:30:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/65b543/32.png) [@ianic](https://www.ruby-forum.com/u/ianic)\
**Post date:** [October 11, 2010, 3:30pm UTC](https://www.ruby-forum.com/t/handling-closed-and-broken-connection/196315/1 "2010-10-11T15:30:49Z")

</div>

Hi all!

Can someone share an idea of the right way of making the worker to wait  
for some event to happen without blocking other requests (eg. for some  
file to appear on the local filesystem)?

I tried setting up the timers but not sure it is a proper way, though it  
is working. The ‘destroyed’ flag is being set while connection is  
actually open and I have to figure out how to handle the closed  
connection event to stop the timers.

Thanks.

---

<div class="post-metadata">

**Author:** ![ianic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/65b543/32.png) [@ianic](https://www.ruby-forum.com/u/ianic)\
**Post date:** [October 11, 2010, 5:26pm UTC](https://www.ruby-forum.com/t/handling-closed-and-broken-connection/196315/2 "2010-10-11T17:26:18Z")

</div>

Also, maybe someone can recommend some existing module which implements  
familiar logic of keeping the connection open without blocking and  
waiting for some event to happen before sending out the file?
