…with an open minded approach

Posts tagged “process

Ruby: pass file descriptor between processes with unix sockets

The gist is (hopefully) self-explanatory – if not, read the header notes

Long story short – use UNIXSocket.send_io/recv_io to pass a file-descriptor between 2 processes.

Also, learned some Jruby limitations (?bug?):

  • Jruby cannot fork()
  • Jruby has UNIXSocket#send_io/recv_io broken, so its not possible to pass file-descriptors with Jruby… what a pitty…

And learned that working with Unix socket in ruby is soooo easy 🙂

Advertisements