Metatell AI Bot - v0.0.10
    Preparing search index...

    Interface IChannelService

    Interface for channel service

    interface IChannelService {
        push<T = unknown>(
            channel: Channel,
            event: string,
            payload?: object,
            options?: PushOptions,
        ): Promise<T>;
        pushParallel(
            channel: Channel,
            operations: BatchPushOperation[],
        ): Promise<PushResult<unknown>[]>;
        pushSequence(
            channel: Channel,
            operations: BatchPushOperation[],
        ): Promise<PushResult<unknown>[]>;
        subscribe(
            channel: Channel,
            event: string,
            handler: (payload: unknown) => void,
        ): () => void;
        waitForEvent<T = unknown>(
            channel: Channel,
            event: string,
            timeoutMs?: number,
        ): Promise<T>;
    }

    Implemented by

    Index

    Methods

    • Push a message to a channel and wait for response

      Type Parameters

      • T = unknown

      Parameters

      Returns Promise<T>

    • Subscribe to channel events

      Parameters

      • channel: Channel
      • event: string
      • handler: (payload: unknown) => void

      Returns () => void

    • Wait for a specific event on a channel

      Type Parameters

      • T = unknown

      Parameters

      • channel: Channel
      • event: string
      • OptionaltimeoutMs: number

      Returns Promise<T>