Method: Evt::Bundled#io_wait

Defined in:
lib/evt/backends/bundled.rb

#io_wait(io, events, duration) ⇒ Object

Wait for the given file descriptor to match the specified events within the specified timeout.



98
99
100
101
102
103
104
105
106
# File 'lib/evt/backends/bundled.rb', line 98

def io_wait(io, events, duration)
  # TODO: IO::PRIORITY
  @readable[io] = Fiber.current unless (events & IO::READABLE).zero?
  @writable[io] = Fiber.current unless (events & IO::WRITABLE).zero?
  self.register(io, events)
  Fiber.yield
  self.deregister(io)
  true
end