@absolunet/ioc2.1.0

View on GitHub

EventEmitterDriver

Dispatcher driver that uses the native EventEmitter from Node.js as dispatcher engine.

Extends

Members

engine :*

Source:
Inherited From:
Current engine accessor.

Methods

makeListenerForEvent(event, listener)

Source:
Make and save a listener that will call the given listener with the event and the payload instead of the payload only.
Parameters:
Name Type Description
event string The event to listen.
listener function The listener.
Returns:
The listener wrapper acting as the listener singleton inside the EventEmitter instance.
Type
function

on(event, listener)

Source:
Overrides:
Add event listener.
Parameters:
Name Type Description
event string The event to listen.
listener function The listener.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

off(event, listener)

Source:
Overrides:
Remove event listener for single listener.
Parameters:
Name Type Description
event string The event that has been listen.
listener function The listener.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

once(event, listener)

Source:
Overrides:
Add event listener for first event dispatch only.
Parameters:
Name Type Description
event string The event to listen.
listener function The listener.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

emit(event, payloadopt)

Source:
Overrides:
Dispatch an event with a given payload.
Parameters:
Name Type Attributes Description
event string The event to dispatch.
payload * <optional>
The payload to send into the listeners.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

removeListeners(event)

Source:
Overrides:
Remove listeners for a given event.
Parameters:
Name Type Description
event string The event that has been listen.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

removeAllListeners()

Source:
Overrides:
Remove all listeners for all events.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

setEngine(engine)

Source:
Inherited From:
Set current engine.
Parameters:
Name Type Description
engine * The engine instance.
Returns:
The current instance.
Type
support.mixins.HasEngine