Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @tmorin/ceb-messaging-simple

Index

Variables

SimpleCommandBusSymbol

SimpleCommandBusSymbol: typeof SimpleCommandBusSymbol = ...

The symbol used to register SimpleCommandBus.

SimpleEventBusSymbol

SimpleEventBusSymbol: typeof SimpleEventBusSymbol = ...

The symbol used to register SimpleEventBus.

SimpleGatewaySymbol

SimpleGatewaySymbol: typeof SimpleGatewaySymbol = ...

The symbol used to register SimpleGateway.

example

Creation and destruction

import { Gateway } from "@tmorin/ceb-messaging-core"
import { SimpleGateway } from "@tmorin/ceb-messaging-simple"
const gateway : Gateway = SimpleGateway.create()
gateway.dispose().catche(e => console.error(e))
example

Global instance

import { MessageBuilder } from "@tmorin/ceb-messaging-core"
import { SimpleGateway } from "@tmorin/ceb-messaging-simple"
const event = MessageBuilder.event("EventA").build()
SimpleGateway.GLOBAL.events.publish(event)

SimpleQueryBusSymbol

SimpleQueryBusSymbol: typeof SimpleQueryBusSymbol = ...

The symbol used to register SimpleQueryBus.

Functions

waitForReturn

  • waitForReturn<R>(fn: (...args: any[]) => Promise<R>, timeout: number): Promise<R>
  • The method wraps a promise fulfillment in order to cancel its resolution when a timeout is reached.

    Type parameters

    • R

    Parameters

    • fn: (...args: any[]) => Promise<R>

      the provide of the promise

        • (...args: any[]): Promise<R>
        • Parameters

          • Rest ...args: any[]

          Returns Promise<R>

    • timeout: number

      the maximum time to wait for in millisecond

    Returns Promise<R>

Generated using TypeDoc