Module: Mongo::Event::Publisher
- Included in:
- Server, Server::Monitor
- Defined in:
- lib/mongo/event/publisher.rb
Overview
This module is included for objects that need to publish events.
Instance Attribute Summary collapse
-
#event_listeners ⇒ Event::Listeners
readonly
Event_listeners The listeners.
Instance Method Summary collapse
-
#publish(event, *args) ⇒ Object
Publish the provided event.
Instance Attribute Details
#event_listeners ⇒ Event::Listeners (readonly)
Returns event_listeners The listeners.
27 28 29 |
# File 'lib/mongo/event/publisher.rb', line 27 def event_listeners @event_listeners end |
Instance Method Details
#publish(event, *args) ⇒ Object
Publish the provided event.
38 39 40 41 42 |
# File 'lib/mongo/event/publisher.rb', line 38 def publish(event, *args) event_listeners.listeners_for(event).each do |listener| listener.handle(*args) end end |