Type Alias ConsumerAPI

ConsumerAPI: {
    add(stream: string, cfg: Partial<ConsumerConfig>): Promise<ConsumerInfo>;
    delete(stream: string, consumer: string): Promise<boolean>;
    info(stream: string, consumer: string): Promise<ConsumerInfo>;
    list(stream: string): Lister<ConsumerInfo>;
    pause(
        stream: string,
        name: string,
        until?: Date,
    ): Promise<{ pause_until?: string; paused: boolean }>;
    resume(
        stream: string,
        name: string,
    ): Promise<{ pause_until?: string; paused: boolean }>;
    update(
        stream: string,
        durable: string,
        cfg: Partial<ConsumerUpdateConfig>,
    ): Promise<ConsumerInfo>;
}

Type declaration

  • add:function
    • Adds a new consumer to the specified stream with the specified consumer options.

      Parameters

      Returns Promise<ConsumerInfo>

  • delete:function
    • Deletes the specified consumer name/durable from the specified stream.

      Parameters

      • stream: string
      • consumer: string

      Returns Promise<boolean>

  • info:function
    • Returns the ConsumerInfo for the specified consumer in the specified stream.

      Parameters

      • stream: string
      • consumer: string

      Returns Promise<ConsumerInfo>

  • list:function
    • Lists all the consumers on the specified streams

      Parameters

      • stream: string

      Returns Lister<ConsumerInfo>

  • pause:function
    • Parameters

      • stream: string
      • name: string
      • Optionaluntil: Date

      Returns Promise<{ pause_until?: string; paused: boolean }>

  • resume:function
    • Parameters

      • stream: string
      • name: string

      Returns Promise<{ pause_until?: string; paused: boolean }>

  • update:function
    • Updates the consumer configuration for the specified consumer on the specified stream that has the specified durable name.

      Parameters

      Returns Promise<ConsumerInfo>