Skip to content

XREAD blocks if count is provided #681

@guytbk

Description

@guytbk

Hi,
I have been using XREAD like so in the past:
streams, err := redis.Values(conn.Do("XREAD", "BLOCK", 0, "STREAMS", stream, key))

Recently, I wanted to start reading in bulks so I opted to this option:
streams, err := redis.Values(conn.Do("XREAD", "BLOCK", 0, "COUNT", bulkSize, "STREAMS", stream, key)) aiming to read UP to "bulkSize" but not block.

With redigo, looks like I am blocking until the number of messages on the stream reach "bulkSize".
However, debugging on the CLI returns immediately usingthe following command:
XREAD BLOCK 0 count 20000 STREAMS changes 1738147923964-1

According to this, it should be supported.

I am using Redis 6.2.14 and redigo v1.8.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions