mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
doc: pass ctx in example for infinite wait time (#2540)
Co-authored-by: Monkey <golang@88.com>
This commit is contained in:
@ -227,7 +227,7 @@ func ExampleClient_BLPop() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// use `rdb.BLPop(0, "queue")` for infinite waiting time
|
// use `rdb.BLPop(ctx, 0, "queue")` for infinite waiting time
|
||||||
result, err := rdb.BLPop(ctx, 1*time.Second, "queue").Result()
|
result, err := rdb.BLPop(ctx, 1*time.Second, "queue").Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Reference in New Issue
Block a user