Class QueryBus

Provide the ability to run queries either locally or on remote systems given the correct publisher.

Hierarchy

Constructors

Properties

_handlerMap: Map<string, IHandler<IQuery, unknown>>
_observableFactory: ObservableFactory
_publisher: IPublisher<IEventLike>

Methods

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

    • If the current application can process the query, meaning the IQuery.$executionDomain property has been registered, the query will be processed synchronously to the main thread and returned.
    • If the current application cannot process the query, the query will be enqueued for processing via a publisher for processing externally and a the results awaited for return.

    Type Parameters

    • TRes

    Parameters

    • query: IQuery

      Query to be processed

    • options: ExecuteOptions = {}

    Returns Promise<TRes>

  • Internal

    Should not be used outside of the context of the library

    Parameters

    • event: IQuery
    • options: Record<string, unknown>

    Returns Promise<unknown>

Generated using TypeDoc