Setu-TS
    Preparing search index...

    Interface EventsPluginOptions

    Options for the EventsPlugin.

    0.1.0

    interface EventsPluginOptions {
        async?: boolean;
        diagnostics?: EventsDiagnosticsOptions;
        errorHandler?: (error: unknown, event: IDomainEvent) => void;
        handlers?: readonly EventHandlerRegistration[];
    }
    Index
    async?: boolean

    Dispatch policy for event handlers.

    • false (default): publish/publishBatch await all handlers before resolving (deterministic ordering).
    • true: fire-and-forget; publish resolves immediately, handler errors are routed to errorHandler asynchronously.

    Opt-in event-dispatch observations (M98j). Absent by default: no collector exists, the source answers disabled, and dispatch is byte-identical to an unobserved bus. Present, it activates the EventsDiagnosticsOptions allowlist and the bounded collector.

    errorHandler?: (error: unknown, event: IDomainEvent) => void

    Handler for errors thrown/rejected by event handlers.

    Defaults to logging via the optional logger capability if present, else a no-op. Errors never cause publish to reject.

    handlers?: readonly EventHandlerRegistration[]

    Handlers subscribed to the bus at register() time.

    The declarative alternative to resolving CAPABILITIES.EVENTS and calling subscribeHandler imperatively — which application code has no phase to do, since IApplication exposes no lifecycle hooks and the bus does not exist until this plugin has registered. Both routes go through the same subscribeHandler, so neither can drift from the other.

    The Unsubscribe each subscription returns is deliberately dropped: the bus is cleared on shutdown (onClose), and there is no caller that could hold the handle.

    Default: [] (no subscriptions).

    0.1.0