Method: Async::Wrapper#wait_readable

Defined in:
lib/async/wrapper.rb

#wait_readable(duration = nil) ⇒ Object

Wait for the io to become readable.

Raises:



88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/async/wrapper.rb', line 88

def wait_readable(duration = nil)
  raise WaitError if @readable
  
  self.reactor = Task.current.reactor
  
  begin
    @readable = Fiber.current
    wait_for(duration)
  ensure
    @readable = nil
    @monitor.interests = interests if @monitor
  end
end