File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,26 @@ Once we get some replies, the next call will be something like:
183183
184184And so forth.
185185
186+ ## The special ` + ` ID
187+
188+ It is sometimes desirable to read the last entry in a stream. For a single
189+ stream this can be easily achieved using the ` XREVRANGE ` command, like so:
190+
191+ ```
192+ > XREVRANGE stream + - COUNT 1
193+ ```
194+ But if there are many streams involved, this approach is quickly becoming
195+ too slow, having to issue a command per stream.
196+ Instead, starting from redis 7.6, the ` + ` sign can be used as a special ID,
197+ requesting the last available entry in a stream. For example:
198+
199+ ```
200+ > XREAD STREAM streamA streamB streamC streamD + + + +
201+ ```
202+
203+ Note that when using this special ID for a stream, the ** COUNT** option will
204+ be ignored (for the specific stream) since only the last entry can be returned.
205+
186206## How multiple clients blocked on a single stream are served
187207
188208Blocking list operations on lists or sorted sets have a * pop* behavior.
You can’t perform that action at this time.
0 commit comments