Skip to content


make the reactor threadsafe #97

tmm1 opened this Issue · 2 comments

3 participants


EM is completely thread-unsafe, which causes all sorts of issues (especially on JRuby).

For instance, sending data to a connection from a non-reactor thread, or invoking EM functions from within signal handlers (i.e. trap{ AMQP.stop }) causes problems.


Recommend EM captures traps and aggregates them into a next tick, maybe an API of EM.trap { ... }. It's not ideal, but, it will solve the problem without monkey patching core libraries.


I'm interested to know exactly what issues have been observed when "sending data to a connection from a non-reactor thread". Further information about eventmachine's failings in this area would be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.