Module: Mongo::Event::Subscriber
- Included in:
- Cluster
- Defined in:
- lib/mongo/event/subscriber.rb
Overview
Adds convenience methods for adding listeners to event publishers.
Instance Attribute Summary collapse
-
#event_listeners ⇒ Event::Listeners
readonly
Event_listeners The listeners.
Instance Method Summary collapse
-
#subscribe_to(event, listener) ⇒ Object
Subscribe to the provided event.
Instance Attribute Details
#event_listeners ⇒ Event::Listeners (readonly)
Returns event_listeners The listeners.
27 28 29 |
# File 'lib/mongo/event/subscriber.rb', line 27 def event_listeners @event_listeners end |
Instance Method Details
#subscribe_to(event, listener) ⇒ Object
Subscribe to the provided event.
38 39 40 |
# File 'lib/mongo/event/subscriber.rb', line 38 def subscribe_to(event, listener) event_listeners.add_listener(event, listener) end |