class Quartz::Hooks::Notifier
- Quartz::Hooks::Notifier
- Reference
- Object
Overview
The Notifier
provides a mechanism for broadcasting hooks during a
simulation.
Hooks can be dispatched either to Proc
s or to Notifiable
objects.
They can register to a hook using the #subscribe
method. Each invocation
of this method registers the receiver to a given hook. Therefore,
objects may register to several hooks.
A default Notifier
instance is associated with Simulation
instances so
that objects can subscribe to simulation events.
Defined in:
quartz/hooks.crInstance Method Summary
-
#clear(hook : Symbol)
Removes all entries that previously registered to the specified hook from the notifier.
-
#clear
Removes all entries from the notifier.
-
#count_listeners(hook : Symbol)
Returns the number of objects listening for the specified hook.
-
#count_listeners
Returns the total number of objects listening to hooks.
-
#notify(hook : Symbol)
Publish a given hook, so that each registered object in the receiver is notified.
-
#subscribe(hook : Symbol, notifiable : Notifiable)
Register the given notifiable to the specified hook.
-
#subscribe(hook : Symbol, &block : Symbol -> )
Register the given block to the specified hook.
-
#unsubscribe(hook : Symbol, instance : Symbol -> | Notifiable)
Unsubscribes the specified entry from listening to the specified hook.
Instance methods inherited from class Reference
==(other : Quartz::Any)
==
Instance methods inherited from class Object
===(other : Quartz::Any)
===
Instance Method Detail
Removes all entries that previously registered to the specified hook from the notifier.
Returns the number of objects listening for the specified hook.
Publish a given hook, so that each registered object in the receiver is notified.
Register the given notifiable to the specified hook.
Unsubscribes the specified entry from listening to the specified hook.