Hierarchy

  • CommandBus
    • CommandBus

Constructors

  • Parameters

    • container: Container
    • observableFactory: ObservableFactory
    • publisher: IPublisher<IEventLike>

    Returns CommandBus

Properties

_handlerMap: Map<string, IHandler<ICommand, unknown>>
_observableFactory: ObservableFactory
_publisher: IPublisher<IEventLike>
_status: StateTracker<ESState>
container: Container

Methods

  • Trigger processing of a given command in one of two ways:

    • If the current application can process the command, meaning the ICommand.$executionDomain property has been registered, the command will be processed asynchronously to the main thread as a Promise without interacting with external systems.
    • If the current application cannot process the command, the command will be enqueued for processing via a publisher for processing externally.

    In either scenario, the response from this function will contain relevant information for subscribing to events emitted by the command processing.

    Returns

    An object containing information about the acknowledged execution

    Parameters

    • command: ICommand

      Command to process

    Returns Promise<CommandResponse>

  • Parameters

    • command: ICommand

    Returns Promise<void>

  • Parameters

    • instance: any

    Returns void

  • Parameters

    • event: ICommand

    Returns Promise<void>

Generated using TypeDoc