mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Support XREAD BLOCK 0
This commit is contained in:
@ -1376,7 +1376,7 @@ func (c *cmdable) XReadExt(opt *XReadExt) *XStreamSliceCmd {
|
|||||||
a = append(a, "count")
|
a = append(a, "count")
|
||||||
a = append(a, opt.Count)
|
a = append(a, opt.Count)
|
||||||
}
|
}
|
||||||
if opt.Block > 0 {
|
if opt.Block >= 0 {
|
||||||
a = append(a, "block")
|
a = append(a, "block")
|
||||||
a = append(a, int64(opt.Block/time.Millisecond))
|
a = append(a, int64(opt.Block/time.Millisecond))
|
||||||
}
|
}
|
||||||
@ -1394,6 +1394,7 @@ func (c *cmdable) XReadExt(opt *XReadExt) *XStreamSliceCmd {
|
|||||||
func (c *cmdable) XRead(streams ...string) *XStreamSliceCmd {
|
func (c *cmdable) XRead(streams ...string) *XStreamSliceCmd {
|
||||||
return c.XReadExt(&XReadExt{
|
return c.XReadExt(&XReadExt{
|
||||||
Streams: streams,
|
Streams: streams,
|
||||||
|
Block: -1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1401,6 +1402,7 @@ func (c *cmdable) XReadN(count int64, streams ...string) *XStreamSliceCmd {
|
|||||||
return c.XReadExt(&XReadExt{
|
return c.XReadExt(&XReadExt{
|
||||||
Streams: streams,
|
Streams: streams,
|
||||||
Count: count,
|
Count: count,
|
||||||
|
Block: -1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user