Agenda - v6.0.0
    Preparing search index...

    Interface NotificationChannel

    Interface for notification channels that enable cross-process job notifications. Implementations can use Redis, PostgreSQL LISTEN/NOTIFY, or other pub/sub systems.

    interface NotificationChannel {
        state: NotificationChannelState;
        connect(): Promise<void>;
        disconnect(): Promise<void>;
        off(
            event: "stateChange",
            listener: (state: NotificationChannelState) => void,
        ): this;
        off(event: "error", listener: (error: Error) => void): this;
        on(
            event: "stateChange",
            listener: (state: NotificationChannelState) => void,
        ): this;
        on(event: "error", listener: (error: Error) => void): this;
        publish(notification: JobNotification): Promise<void>;
        subscribe(handler: NotificationHandler): () => void;
    }

    Implemented by

    Index

    Properties

    Current state of the channel

    Methods