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

Function ExampleClient_TxPipeline

example_test.go:453–470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

451}
452
453func ExampleClient_TxPipeline() {
454 pipe := rdb.TxPipeline()
455
456 incr := pipe.Incr(ctx, "tx_pipeline_counter")
457 pipe.Expire(ctx, "tx_pipeline_counter", time.Hour)
458
459 // Execute
460 //
461 // MULTI
462 // INCR pipeline_counter
463 // EXPIRE pipeline_counts 3600
464 // EXEC
465 //
466 // using one rdb-server roundtrip.
467 _, err := pipe.Exec(ctx)
468 fmt.Println(incr.Val(), err)
469 // Output: 1 <nil>
470}
471
472func ExampleClient_Watch() {
473 const maxRetries = 10000

Callers

nothing calls this directly

Calls 5

TxPipelineMethod · 0.65
IncrMethod · 0.65
ExpireMethod · 0.65
ExecMethod · 0.65
ValMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…