'how to tell redis to wait until x many messages are received?
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?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | eagr |
