Class KQueue::Event
In: lib/rb-kqueue/event.rb
Parent: Object

An event produced by kqueue. Each {Watcher} can fire many events, which are passed to that Watcher‘s callback.

Methods

callback!   eof?   flags   new   watcher  

Attributes

data  [R]  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`.

@return [Fixnum]

filter  [R]  The name of the kqueue filter that created this event, e.g. `:vnode` or `:read`.

@private @return [Symbol]

Public Class methods

Creates a new event from a native event structure.

@private @param native [Native::Event] The native event structure

  from which to construct this event

@param queue [Queue] The queue that produced this event @raise [SystemCallError] If this event signals an error

Public Instance methods

Runs the callback for this event. This callback is associated with the {Watcher} that produced the event.

@private @return [void]

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?`.

@return [Boolean]

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`.

@return [Array<Symbol>]

The {Watcher} that produced this event.

@return [Watcher]

[Validate]