Method: Mongo::Monitoring::Subscribable#subscribe
- Defined in:
- lib/mongo/monitoring.rb
#subscribe(topic, subscriber) ⇒ Object
Note:
It is possible to subscribe the same listener to the same topic
Subscribe a listener to an event topic.
multiple times, in which case the listener will be invoked as many times as it is subscribed and to unsubscribe it the same number of unsubscribe calls will be needed.
105 106 107 |
# File 'lib/mongo/monitoring.rb', line 105 def subscribe(topic, subscriber) subscribers_for(topic).push(subscriber) end |