From 15bc840a11044e8a175c3d28277513aba6e259e8 Mon Sep 17 00:00:00 2001 From: Sajjad Khodadadi Date: Sat, 30 Sep 2023 17:34:04 +0330 Subject: [PATCH 1/2] Fix stream name mismatch in code and the text in the code above the suggested diff, the stream name is `race:france` which is coherent with all the other example in the doc. but it's wrongly named `mystream` --- docs/data-types/streams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data-types/streams.md b/docs/data-types/streams.md index 378c99cd76..ea17ff1605 100644 --- a/docs/data-types/streams.md +++ b/docs/data-types/streams.md @@ -326,7 +326,7 @@ Apart from the fact that `XREAD` can access multiple streams at once, and that w > XREAD BLOCK 0 STREAMS race:france $ ``` -Note that in the example above, other than removing **COUNT**, I specified the new **BLOCK** option with a timeout of 0 milliseconds (that means to never timeout). Moreover, instead of passing a normal ID for the stream `mystream` I passed the special ID `$`. This special ID means that `XREAD` should use as last ID the maximum ID already stored in the stream `mystream`, so that we will receive only *new* messages, starting from the time we started listening. This is similar to the `tail -f` Unix command in some way. +Note that in the example above, other than removing **COUNT**, I specified the new **BLOCK** option with a timeout of 0 milliseconds (that means to never timeout). Moreover, instead of passing a normal ID for the stream `race:france` I passed the special ID `$`. This special ID means that `XREAD` should use as last ID the maximum ID already stored in the stream `mystream`, so that we will receive only *new* messages, starting from the time we started listening. This is similar to the `tail -f` Unix command in some way. Note that when the **BLOCK** option is used, we do not have to use the special ID `$`. We can use any valid ID. If the command is able to serve our request immediately without blocking, it will do so, otherwise it will block. Normally if we want to consume the stream starting from new entries, we start with the ID `$`, and after that we continue using the ID of the last message received to make the next call, and so forth. From cdfef49a9cfb26664eb958c6a661588ede06419e Mon Sep 17 00:00:00 2001 From: David Dougherty Date: Tue, 24 Oct 2023 14:04:40 -0700 Subject: [PATCH 2/2] Update docs/data-types/streams.md --- docs/data-types/streams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data-types/streams.md b/docs/data-types/streams.md index ea17ff1605..af07ba7f58 100644 --- a/docs/data-types/streams.md +++ b/docs/data-types/streams.md @@ -326,7 +326,7 @@ Apart from the fact that `XREAD` can access multiple streams at once, and that w > XREAD BLOCK 0 STREAMS race:france $ ``` -Note that in the example above, other than removing **COUNT**, I specified the new **BLOCK** option with a timeout of 0 milliseconds (that means to never timeout). Moreover, instead of passing a normal ID for the stream `race:france` I passed the special ID `$`. This special ID means that `XREAD` should use as last ID the maximum ID already stored in the stream `mystream`, so that we will receive only *new* messages, starting from the time we started listening. This is similar to the `tail -f` Unix command in some way. +Note that in the example above, other than removing **COUNT**, I specified the new **BLOCK** option with a timeout of 0 milliseconds (that means to never timeout). Moreover, instead of passing a normal ID for the stream `race:france` I passed the special ID `$`. This special ID means that `XREAD` should use as last ID the maximum ID already stored in the stream `race:france`, so that we will receive only *new* messages, starting from the time we started listening. This is similar to the `tail -f` Unix command in some way. Note that when the **BLOCK** option is used, we do not have to use the special ID `$`. We can use any valid ID. If the command is able to serve our request immediately without blocking, it will do so, otherwise it will block. Normally if we want to consume the stream starting from new entries, we start with the ID `$`, and after that we continue using the ID of the last message received to make the next call, and so forth.