Discussion:
Non-blocking ractor receive?
Charles Hixson
2021-05-29 15:28:33 UTC
Permalink
If I read the documentation correctly, it looks as if a non-blocking
ractor receive is impossible.  At first I hoped that select would work,
but the examples seem to indicate that it wouldn't, and there appears to
be no non-blocking way to tell whether or not the receive queue is empty.

Is this correct?  Is the proper response to use a mixture of threads and
ractors?  Fibers wouldn't seem to work, as those are (IIUC) just
co-routines.  Or is this just something that Ruby doesn't support?

FWIW, I have the need to do lots of "housekeeping tasks" while also
responding quickly to messages from concurrently executing routines that
are based around often different chunks of code.
--
Javascript is what you use to allow third part programs you don't know anything about and doing you know not what to run on your computer.


Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/r
Loading...