class KQueue::Watcher::ReadWrite
The {Watcher} subclass for events fired when a stream can be read from or written to (which of these is determined by {#type}). Read events are watched via {Queue#watch_stream_for_read}, and write events are watched via {Queue#watch_stream_for_write}.
Note that read and write events for sockets use the {SocketReadWrite} class.
Attributes
fd[R]
The file descriptor for the stream being watched.
@return [Fixnum]
io[R]
The Ruby IO object from which the file descriptor was extracted. This is only set if an IO object was used to construct this watcher. Otherwise, it's `nil`.
@return [IO, nil]
type[R]
The type of watcher, `:read` or `:write`.
@return [Symbol]
Public Class Methods
new(queue, fd, type, callback)
click to toggle source
Creates a new read/write Watcher.
@private
Calls superclass method
KQueue::Watcher.new
# File lib/rb-kqueue/watcher/read_write.rb, line 32 def initialize(queue, fd, type, callback) if fd.is_a?(IO) @io = fd fd = fd.fileno end @fd = fd @type = type super(queue, @fd, type, [], nil, callback) end