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

Method newTx

tx.go:43–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (c *Client) newTx() *Tx {
44 tx := Tx{
45 baseClient: baseClient{
46 opt: c.cloneOpt(), // Clone options under optLock to avoid race with initConn
47 connPool: pool.NewStickyConnPool(c.connPool),
48 hooksMixin: c.hooksMixin.clone(),
49 pushProcessor: c.pushProcessor, // Copy push processor from parent client
50 onClose: &onCloseHooks{},
51 },
52 }
53 tx.init()
54 return &tx
55}
56
57func (c *Tx) init() {
58 c.cmdable = c.Process

Callers 1

WatchMethod · 0.95

Calls 4

initMethod · 0.95
NewStickyConnPoolFunction · 0.92
cloneOptMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected