Event class

Concrete implementation of IEvent interface. It allows to send asynchronous notifications to multiple subscribed listeners.

See IEvent See IEventListener

Example

var event =  Event('my_event');

event.addListener(myListener);

event.notify('123', Parameters.fromTuples(
  ['param1', 'ABC',
  'param2', 123]
));
Implemented types

Constructors

Event(String name)
Creates a new event and assigns its name. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addListener(IEventListener listener) → void
Adds a listener to receive notifications when this event is fired. [...]
override
getListeners() List<IEventListener>
Gets all listeners registred in this event. [...]
override
getName() String
Gets the name of the event. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notify(String correlationId, Parameters args) → void
Fires this event and notifies all registred listeners. [...]
override
removeListener(IEventListener listener) → void
Removes a listener, so that it no longer receives notifications for this event. [...]
override
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited