You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below.
It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you!
Version:
redis-py vesion: 3.2.0
Redis: 5.0.3
Platform: CentOS7, Python 3.6
Description:
special id $ doesn't work. ( according to Reddis doc , it should fetch the newest unread messages, but it doesn't ).
Code example
if__name__=='__main__':
r=redis.Redis(host='localhost', port=6379, db=0)
encoder=JSONEncoder()
sample= {"hello": encoder.encode([1234,125, 1235, 1235])} # converts list to stringstream_name='mystream'foriinrange(10):
r.xadd(stream_name, sample)
read_samples=r.xread({stream_name:b"$"}, block=10000)
print(read_samples) # prints empty list
But if I replace b"$" with b"0-0", it works fine.
The text was updated successfully, but these errors were encountered:
The special $ ID is only for messages that are added to the stream AFTER you start reading with XREAD. In your example above, you add the messages to the stream first, then call XREAD. Doing it in the reverse order will work as expected (though you'll need to add the messages from another process or thread).
Thanks for wanting to report an issue you've found in redis-py. Please delete this text and fill in the template below.
It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you!
Version:
redis-py vesion: 3.2.0
Redis: 5.0.3
Platform: CentOS7, Python 3.6
Description:
special id
$
doesn't work. ( according to Reddis doc , it should fetch the newest unread messages, but it doesn't ).Code example
But if I replace
b"$"
withb"0-0"
, it works fine.The text was updated successfully, but these errors were encountered: