Class: KQueue::Watcher::ReadWrite
- Inherits:
-
KQueue::Watcher
- Object
- KQueue::Watcher
- KQueue::Watcher::ReadWrite
- Defined in:
- lib/rb-kqueue/watcher/read_write.rb
Overview
The KQueue::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.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fd ⇒ Fixnum
readonly
The file descriptor for the stream being watched.
-
#io ⇒ IO?
readonly
The Ruby IO object from which the file descriptor was extracted.
-
#type ⇒ Symbol
readonly
The type of watcher,
:reador:write.
Attributes inherited from KQueue::Watcher
Method Summary
Methods inherited from KQueue::Watcher
#add!, #delete!, #disable!, #enable!
Instance Attribute Details
#fd ⇒ Fixnum (readonly)
The file descriptor for the stream being watched.
22 23 24 |
# File 'lib/rb-kqueue/watcher/read_write.rb', line 22 def fd @fd end |
#io ⇒ IO? (readonly)
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.
17 18 19 |
# File 'lib/rb-kqueue/watcher/read_write.rb', line 17 def io @io end |
#type ⇒ Symbol (readonly)
The type of watcher, :read or :write.
27 28 29 |
# File 'lib/rb-kqueue/watcher/read_write.rb', line 27 def type @type end |