kkrpc
    Preparing search index...

    Class RedisStreamsIO

    Redis Streams implementation of IoInterface

    支持两种消息消费模式:

    1. Pub/Sub 模式 (默认): 使用 XREAD,所有 consumer 都能收到所有消息
    2. Consumer Group 模式: 使用 XREADGROUP,每条消息只被一个 consumer 处理 (负载均衡)

    内存管理:

    • 支持最大队列大小限制 (maxQueueSize),防止消息积压导致内存问题
    • 队列满时自动丢弃最老的消息并记录警告

    配置验证:

    • 构造时验证所有配置选项的类型和范围
    • 无效配置会立即抛出异常

    Implements

    Index

    Constructors

    Properties

    capabilities: IoCapabilities = ...
    name: string = "redis-streams-io"

    Methods

    • Get all entries in the stream (for debugging purposes)

      Returns Promise<[string, string[]][]>

    • Get stream information (length, groups, etc.)

      Returns Promise<{ groups: number; lastEntry: null | string; length: number }>

    • Trim the stream to keep only the last N entries

      Parameters

      • maxLen: number

      Returns Promise<void>