Add EventMachine.attach_server#465
Conversation
|
cc @brianmario |
… socket. Otherwise the FD could be closed by a GC.
|
I've simplified this to one method that accepts a socket or FD. It also holds onto a reference to the socket so that the FD is not closed when the socket object is GC'd. |
Add EventMachine.attach_server & EventMachine.attach_socket_server
|
omg I love you so much
|
|
any chance we can get the method added that returns the FD num for Connection objects and accept signatures? ;)
|
|
@brianmario are you talking about this signature? https://github.com/macournoyer/thin/blob/master/lib/thin/backends/unix_server.rb#L22 I've been reusing this hack, but I think it makes sense for this method to return the signature. |
|
right yeah. the issue is that the signature is used all over the rest of the EM API to track these, not the FD number. I need a way to get the FD for a signature
|
|
Was this ever implemented for JRuby? https://github.com/eventmachine/eventmachine/pull/271/files#r22436804 If not, the test should be skipped on JRuby #551. |
This adds the
EventMachine.attach_server&EventMachine.attach_socket_servermethods for registering an existing FD/socket created outside of EventMachine. It's a simplified version of #271, but without the CLOEXEC/autoclose stuff. This allows sockets to be shared between parent & child processes like with unicorn's fork-then-exec graceful restart functionality.