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

Method Unwatch

tx.go:121–134  ·  view source on GitHub ↗

Unwatch flushes all the previously watched keys for a transaction.

(ctx context.Context, keys ...string)

Source from the content-addressed store, hash-verified

119
120// Unwatch flushes all the previously watched keys for a transaction.
121func (c *Tx) Unwatch(ctx context.Context, keys ...string) *StatusCmd {
122 args := make([]interface{}, 1+len(keys))
123 args[0] = "unwatch"
124 for i, key := range keys {
125 args[1+i] = key
126 }
127 cmd := NewStatusCmd(ctx, args...)
128 _ = c.Process(ctx, cmd)
129 // The watched keys have been released, so Close need not UNWATCH again.
130 if cmd.Err() == nil {
131 c.watchArmed = false
132 }
133 return cmd
134}
135
136// Pipeline creates a pipeline. Usually it is more convenient to use Pipelined.
137func (c *Tx) Pipeline() Pipeliner {

Callers 2

CloseMethod · 0.95
tx_unwatch_test.goFile · 0.80

Calls 3

ProcessMethod · 0.95
NewStatusCmdFunction · 0.85
ErrMethod · 0.65

Tested by

no test coverage detected