how to tell redis to wait until x many messages are received?

Viewed 51

i was reading into xread function in redis. I was thinking doing something like this:

await r.xread({'stream_name': '$'}, count=10, block=0)

would tell redis to wait until 10 messages are received and hence i can do my processing (such as push to another database). But it seems the function automatically gets me the next record without fail. Is there any way to tell redis to wait until x messages are added into the stream from another process?

1 Answers

The count argument specifies the maximum number of items to return (but not to wait for). Currently there seems to be no way to specify the minimum amount to block for.

Related