1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Embed Cmdable into StatefulCmdable

This commit is contained in:
Vladimir Mihailenco
2017-05-25 13:38:04 +03:00
parent 368f0ea0ba
commit 7e8890b644
7 changed files with 23 additions and 23 deletions

7
tx.go
View File

@ -13,7 +13,6 @@ const TxFailedErr = internal.RedisError("redis: transaction failed")
// by multiple goroutines, because Exec resets list of watched keys.
// If you don't need WATCH it is better to use Pipeline.
type Tx struct {
cmdable
statefulCmdable
baseClient
}
@ -25,8 +24,7 @@ func (c *Client) newTx() *Tx {
connPool: pool.NewStickyConnPool(c.connPool.(*pool.ConnPool), true),
},
}
tx.cmdable.process = tx.Process
tx.statefulCmdable.process = tx.Process
tx.setProcessor(tx.Process)
return &tx
}
@ -80,8 +78,7 @@ func (c *Tx) Pipeline() Pipeliner {
pipe := Pipeline{
exec: c.pipelineExecer(c.txPipelineProcessCmds),
}
pipe.cmdable.process = pipe.Process
pipe.statefulCmdable.process = pipe.Process
pipe.setProcessor(pipe.Process)
return &pipe
}