Method: IO#await_readable
- Defined in:
- lib/all/io.rb
#await_readable(opts = {}) ⇒ true
Suspends the current evaluation until IO is readable.
While waiting, the code jumps to the event loop and executes other evaluations that are ready to run in the meantime.
77 78 79 80 81 82 83 |
# File 'lib/all/io.rb', line 77 def await_readable(opts = {}) io_selector = Concurrently::EventLoop.current.io_selector io_selector.await_reader(self, Concurrently::Evaluation.current) await_resume! opts ensure io_selector.cancel_reader(self) end |