I am using Redis streams and basically have a stream that will append an END sentinel message when it's done. Until then, I basically want to mimic tail -f which is when I begin a read I want to see all previous logs until the current time and then keep getting new updates from the stream indefinitely.
I realize I can probably replicate this by polling from the last fetched timestamp but was wondering if there is some natively supported way to do this. I could not find one in the docs and it's getting me to wonder if for some reason this is a bad idea
I have tried calling xread with a very high block count but that did not work as it returns as soon as there are new results
See https://redis-doc-test.readthedocs.io/en/latest/commands/xread/
You are looking for the
$special ID, which is the highest defined key (as opposed to+which is the highest possible key). After the first read, you typically use the last retrieved ID as the key for the next read.Here's an example that uses
asyncio: