Method: Async::Wrapper#wait_writable

Defined in:
lib/async/wrapper.rb

#wait_writable(duration = nil) ⇒ Object

Wait for the io to become writable.

Raises:



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/async/wrapper.rb', line 103

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