nyx Typedoc
    Preparing search index...

    Interface SyncEventDispatcher

    An object for dispatching events to an array of EventSubscriber, performing middleware and error catching logic in the process.

    interface SyncEventDispatcher {
        dispatch(
            subscribers: AnyEventSubscriber[],
            args: [meta: Metadata, ...args: unknown[]],
        ): Awaitable<void>;
        getErrorHandler(): EventSubscriberErrorHandler;
        getMiddleware(): MiddlewareList<
            MiddlewareResolvable<AnyEventSubscriber, [Metadata, ...unknown[]]>,
        >;
        getSyncTimeout(): number | null;
        setSyncTimeout(timeout: number | null): this;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    • Sets the maximum sync execution time of a subscriber.

      If this time is reached and the subscriber's execution still hasn't finished, the subscriber's execution is moved to parallel and the next subscriber is called.

      Useful for avoiding long sync subscribers blocking the event loop. Setting it to null turns off this behavior.

      Parameters

      • timeout: number | null

      Returns this