Class: KQueue::Event
- Inherits:
-
Object
- Object
- KQueue::Event
- Defined in:
- lib/rb-kqueue/event.rb
Overview
An event produced by kqueue. Each Watcher can fire many events, which are passed to that Watcher's callback.
Instance Attribute Summary collapse
-
#data ⇒ Fixnum
readonly
Some integer data, the interpretation of which is specific to each individual Watcher.
Instance Method Summary collapse
-
#eof? ⇒ Boolean
Returns whether the end-of-file flag has been set for this event.
-
#flags ⇒ Array<Symbol>
An array of flags, the interpretation of which is specific to each individual Watcher.
-
#watcher ⇒ Watcher
The Watcher that produced this event.
Instance Attribute Details
#data ⇒ Fixnum (readonly)
Some integer data, the interpretation of which is specific to each individual Watcher. For specifics, see the individual Watcher subclasses.
data
is not meaningful for all events.
For example, file-change notifications do not set data
.
14 15 16 |
# File 'lib/rb-kqueue/event.rb', line 14 def data @data end |
Instance Method Details
#eof? ⇒ Boolean
Returns whether the end-of-file flag has been set for this event. The interpretation of this is specific to each individual Watcher.
eof?
is not meaningful for all events.
For example, file-change notifications don't set eof?
.
52 53 54 |
# File 'lib/rb-kqueue/event.rb', line 52 def eof? @flags.include?(:eof) end |
#flags ⇒ Array<Symbol>
An array of flags, the interpretation of which is specific to each individual Watcher.
If the Watcher watches for different sorts of events,
this is usually the specific events that actually occurred.
For example, for file-change notifications this could be [:delete]
.
flags
is not meaningful for all events.
For example, readability notifications do not set flags
.
41 42 43 |
# File 'lib/rb-kqueue/event.rb', line 41 def flags @fflags ||= Native::Flags.from_mask("NOTE_#{filter.to_s.upcase}", @native[:fflags]) end |