Skip to content

Commit

Permalink
Add hint on Streams usage
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Jan 12, 2020
1 parent 13b6cb3 commit 08dad1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down

0 comments on commit 08dad1e

Please sign in to comment.