Signaling Ruby from C/C++

Asterix Gallier wrote:

But there is although the problem, that if I’m reading from the
descriptor, and no data is there, the complete ruby application blocks.

You’re going to face this problem in any case, since you want your Ruby
code to be responsive to interruptions from the native code. You can set
the reader socket nonblocking and poll it in your main Ruby loop, or you
can read the reader socket on a separate Ruby thread and have it signal
your main loop by scheduling objects onto a Queue.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs