123456789_123456789_123456789_123456789_123456789_

The ::NIO::Monitor class monitors a specific IO object and lets you introspect on why that object was selected. Monitors are returned by [[Selectors]] whenever you #register an IO object or whenever they #select as ready for a particular interests.

NIO::Monitors are thread safe only if you are holding the selector lock (i.e. if you're in a block passed to #select). Don't share them between multiple threads unless only one thread at a time is calling #select.

The following methods are available for manipulating and inspecting interests:

Monitors also support a #value and #value= accessor for storing a handle to an arbitrary object of your choice (e.g. a proc with a callback to fire on a given event)

See Also