Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Event

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

see

IEvent

see

IEventListener

Example

let event = new Event("my_event");

event.addListener(myListener);

event.notify("123", Parameters.fromTuples(
  "param1", "ABC",
  "param2", 123
));

Hierarchy

  • Event

Implements

Index

Constructors

constructor

  • new Event(name: string): Event
  • Creates a new event and assigns its name.

    throws

    an Error if the name is null.

    Parameters

    • name: string

      the name of the event that is to be created.

    Returns Event

Methods

addListener

getListeners

getName

  • getName(): string

notify

  • notify(correlationId: string, args: Parameters): void
  • Fires this event and notifies all registred listeners.

    throws

    an InvocationException if the event fails to be raised.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • args: Parameters

      the parameters to raise this event with.

    Returns void

removeListener

Generated using TypeDoc