Class Rev::Watcher
In: ext/rev/rev_buffer.c
Parent: Object

Watchers are Rev‘s event observers. They contain a set of callback methods prefixed by on_* which fire whenever events occur.

In order for a watcher to fire events it must be attached to a running loop. Every watcher has an attach and detach method to control which loop it‘s associated with.

Watchers also have an enable and disable method. This allows a watcher to temporarily ignore certain events while remaining attached to a given loop. This is good for watchers which need to be toggled on and off.


attach   attached?   detach   disable   enable   enabled?   evloop  

Public Instance methods

Attach the watcher to the given Rev::Loop. If the watcher is already attached to a loop, detach it from the old one and attach it to the new one.

Is the watcher currently attached to an event loop?

Detach the watcher from its current Rev::Loop.

Temporarily disable an event watcher which is attached to a loop. This is useful if you wish to toggle event monitoring on and off.

Re-enable a watcher which has been temporarily disabled. See the disable method for a more thorough explanation.

Return the loop to which we‘re currently attached