Add hint on Streams usage

This commit is contained in:
Vladimir Mihailenco 2020-01-12 12:14:22 +02:00
parent 13b6cb3891
commit 08dad1eb7f
1 changed files with 2 additions and 1 deletions

View File

@ -1405,7 +1405,7 @@ func (c cmdable) XRevRangeN(stream, start, stop string, count int64) *XMessageSl
}
type XReadArgs struct {
Streams []string
Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2
Count int64
Block time.Duration
}
@ -1421,6 +1421,7 @@ func (c cmdable) XRead(a *XReadArgs) *XStreamSliceCmd {
args = append(args, "block")
args = append(args, int64(a.Block/time.Millisecond))
}
args = append(args, "streams")
for _, s := range a.Streams {
args = append(args, s)