class NIO::Monitor

Monitors watch IO objects for specific events

def close(deregister = true)

Deactivate this monitor
def close(deregister = true)
  @closed = true
  @selector.deregister(io) if deregister
end

def closed?; @closed; end

Is this monitor closed?
def closed?; @closed; end

def initialize(io, interests, selector)

:nodoc
def initialize(io, interests, selector)
  unless io.is_a?(IO)
    if IO.respond_to? :try_convert
      io = IO.try_convert(io)
    elsif io.respond_to? :to_io
      io = io.to_io
    end
    raise TypeError, "can't convert #{io.class} into IO" unless io.is_a? IO
  end
  @io, @interests, @selector = io, interests, selector
  @closed = false
end

def readable?

Is the IO object readable?
def readable?
  readiness == :r || readiness == :rw
end

def writable?

Is the IO object writable?
def writable?
  readiness == :w || readiness == :rw
end