mirror of https://github.com/go-redis/redis.git
Add hint on Streams usage
This commit is contained in:
parent
13b6cb3891
commit
08dad1eb7f
|
@ -1405,7 +1405,7 @@ func (c cmdable) XRevRangeN(stream, start, stop string, count int64) *XMessageSl
|
||||||
}
|
}
|
||||||
|
|
||||||
type XReadArgs struct {
|
type XReadArgs struct {
|
||||||
Streams []string
|
Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2
|
||||||
Count int64
|
Count int64
|
||||||
Block time.Duration
|
Block time.Duration
|
||||||
}
|
}
|
||||||
|
@ -1421,6 +1421,7 @@ func (c cmdable) XRead(a *XReadArgs) *XStreamSliceCmd {
|
||||||
args = append(args, "block")
|
args = append(args, "block")
|
||||||
args = append(args, int64(a.Block/time.Millisecond))
|
args = append(args, int64(a.Block/time.Millisecond))
|
||||||
}
|
}
|
||||||
|
|
||||||
args = append(args, "streams")
|
args = append(args, "streams")
|
||||||
for _, s := range a.Streams {
|
for _, s := range a.Streams {
|
||||||
args = append(args, s)
|
args = append(args, s)
|
||||||
|
|
Loading…
Reference in New Issue