Class Bus<TEvent>

Propagating event bus implementation.

Type Parameters

Hierarchy

Implements

Constructors

Properties

awareOfContainerLifecycle: true = ...
config: Config
connectors: Collection<EventBus<Event>> = ...

Connections to other event busses to be propagated.

isUp: boolean = false

True if the bus has been initialized.

logging: Logging
status: UnitStatus = UnitStatus.Stopped

The current status of the unit.

subscribers: Collection<BusSubscriber<Event>> = ...

Local listeners subscribed to events on this bus.

subscriptions: Collection<BusInternalSubscription> = ...
uuid: string = ...

Accessors

Methods

  • Protected

    Call all local listeners for the given event. Returns true if the propagation of the event should be halted.

    Parameters

    • event: TEvent

    Returns Promise<boolean>

  • Get the method with the given name from this class, bound to this class.

    Returns

    function

    Parameters

    • methodName: string

    Returns ((...args: any[]) => any)

      • (...args: any[]): any
      • Get the method with the given name from this class, bound to this class.

        Returns

        function

        Parameters

        • Rest ...args: any[]

        Returns any

  • Call the make() method on the global container.

    Type Parameters

    • T

    Parameters

    • target: any
    • Rest ...parameters: any[]

    Returns T

  • Returns true if the given event should be pushed to connected event busses.

    Parameters

    Returns Promise<boolean>

  • Initialize this event bus.

    Parameters

    • createUpstreamFromConfig: boolean = true

    Returns Promise<void>