()
| 41 | } |
| 42 | |
| 43 | func (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 | |
| 57 | func (c *Tx) init() { |
| 58 | c.cmdable = c.Process |
no test coverage detected