Class Mongo::Event::Listeners
In: lib/mongo/event/listeners.rb
Parent: Object

The queue of events getting processed in the client.

@since 2.0.0

Methods

Public Class methods

Initialize the event listeners.

@example Initialize the event listeners.

  Listeners.new

@since 2.0.0

Public Instance methods

Add an event listener for the provided event.

@example Add an event listener

  publisher.add_listener("my_event", listener)

@param [ String ] event The event to listen for. @param [ Object ] listener The event listener.

@return [ Array<Object> ] The listeners for the event.

@since 2.0.0

Get the listeners for a specific event.

@example Get the listeners.

  publisher.listeners_for("test")

@param [ String ] event The event name.

@return [ Array<Object> ] The listeners.

@since 2.0.0

[Validate]