I am writing an application that requires non-blocking reads of $stdin
.
Normally (if I were using Ruby rather than mRuby) I would accomplish this via the Thread
and Queue
class. Unfortunately, mRuby does not provide these natively and it appears that this might not be possible in the mruby-thread gem.
How do I perform a non-blocking read of $stdin.gets() in mRuby, preferably without the use of custom extensions?