Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix to prevent event machine from stopping when a raise is done in an unbind. #327
Currently, eventmachine will stop when a handler raises an exception in its unbind method. This is an intended feature for when the eventmachine reactor is being stopped, as it is undesirable to keep the reactor running when exceptions are being thrown while connections are being unbound.
This however does cause issues when exceptions are raised in unbinds when eventmachine is not being stopped.
This fix adds a method to the eventmachine cpp module which enables you to check wether or not the reactor is being stopped. Consequently the raising of an exception during an unbind will only resort in a reactor stop if it was already being stopped.
We implemented this locally for a project, tested it and it seems to be working well. Granted, this is only necessary if handler code implements exceptions in the unbind method.
Tests have been added, and the existing ones all still pass.