Method: Concurrent::Selectable::Base#wait
- Defined in:
- lib/concurrent/selectable/common.rb
#wait(timeout = nil) ⇒ Object
Waits for the primitive to become available/signaled, with the given timeout (see IO.select). If timeout is given and is not nil, then TimeoutError will be raised if the timeout is exceeded.
52 53 54 55 56 |
# File 'lib/concurrent/selectable/common.rb', line 52 def wait(timeout=nil) ready = IO.select([@read], nil, nil, timeout) raise TimeoutError, "wait timed out" unless ready self end |