Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Bus<TEvent>

Propagating event bus implementation.

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

  • new Bus<TEvent>(): Bus<TEvent>

Properties

awareOfContainerLifecycle

awareOfContainerLifecycle: true = true

Protected Readonly config

config: Config

Protected connectors

connectors: Collection<EventBus<Event>> = ...

Connections to other event busses to be propagated.

Private isUp

isUp: boolean = false

True if the bus has been initialized.

Protected Readonly logging

logging: Logging

status

status: UnitStatus = ...

The current status of the unit.

Protected subscribers

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

Local listeners subscribed to events on this bus.

Protected subscriptions

subscriptions: Collection<BusInternalSubscription> = ...

Readonly uuid

uuid: string = ...

Accessors

Private appClassApplication

Methods

Protected app

Protected callSubscribers

  • callSubscribers(event: TEvent): Promise<boolean>
  • 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>

connect

Protected container

disconnect

down

  • down(): Promise<void>

getBoundMethod

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

    Parameters

    • methodName: string

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

    function

      • (...args: any[]): any
      • Parameters

        • Rest ...args: any[]

        Returns any

isConnected

  • isConnected(): boolean

Protected make

  • make<T>(target: any, ...parameters: any[]): T
  • Call the make() method on the global container.

    Type parameters

    • T

    Parameters

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

    Returns T

onContainerDestroy

pipe

push

  • push(event: TEvent): Promise<void>

Protected shouldBroadcast

  • shouldBroadcast(event: Event): Promise<boolean>
  • Returns true if the given event should be pushed to connected event busses.

    Parameters

    Returns Promise<boolean>

subscribe

up

  • up(createUpstreamFromConfig?: boolean): Promise<void>
Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.