MCPcopy
hub / github.com/redis/go-redis / ExampleClient_Pipelined

Function ExampleClient_Pipelined

example_test.go:414–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412}
413
414func ExampleClient_Pipelined() {
415 var incr *redis.IntCmd
416 _, err := rdb.Pipelined(ctx, func(pipe redis.Pipeliner) error {
417 incr = pipe.Incr(ctx, "pipelined_counter")
418 pipe.Expire(ctx, "pipelined_counter", time.Hour)
419 return nil
420 })
421 fmt.Println(incr.Val(), err)
422 // Output: 1 <nil>
423}
424
425func ExampleClient_Pipeline() {
426 pipe := rdb.Pipeline()

Callers

nothing calls this directly

Calls 4

ValMethod · 0.95
PipelinedMethod · 0.65
IncrMethod · 0.65
ExpireMethod · 0.65

Tested by

no test coverage detected