I am using pyredis==5.0.3 and fakeredis=2.22.0 in Python3.8.10, and the output of XREAD from the fake library is different from the one of a real Redis client. Specifically, the faker library always returns an empty array when using a blocking call against XREAD, unless count is also set. I have tried using 5.0.7 and 7.2.4 for my redis server, and gotten the same results.
Looking in the code, a Nonecount parameter of the XREAD is preventing the _xread method from returning the relevant items.
def _xread(...):
...
stream_results = self._xrange(item.value, start_id, max_inf, False, count)
if first_pass and (count is None):
return None
...
Is this by design, or a bug? If it's by design, could you share more about the reason why this specific behavior is different from the one in real redis?
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
I am using
pyredis==5.0.3
andfakeredis=2.22.0
inPython3.8.10
, and the output ofXREAD
from the fake library is different from the one of a real Redis client. Specifically, the faker library always returns an empty array when using a blocking call againstXREAD
, unlesscount
is also set. I have tried using5.0.7
and7.2.4
for my redis server, and gotten the same results.Here is a small demo to reproduce:
Which yields the output:
Looking in the code, a
None
count
parameter of theXREAD
is preventing the_xread
method from returning the relevant items.Is this by design, or a bug? If it's by design, could you share more about the reason why this specific behavior is different from the one in real redis?
Upvote & Fund