mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
pipeline now has its own interface "Pipelineable"
This commit is contained in:
8
redis.go
8
redis.go
@ -61,7 +61,7 @@ func (c *baseClient) initConn(cn *pool.Conn) error {
|
||||
|
||||
// Temp client for Auth and Select.
|
||||
client := newClient(c.opt, pool.NewSingleConnPool(cn))
|
||||
_, err := client.Pipelined(func(pipe *Pipeline) error {
|
||||
_, err := client.Pipelined(func(pipe Pipelineable) error {
|
||||
if c.opt.Password != "" {
|
||||
pipe.Auth(c.opt.Password)
|
||||
}
|
||||
@ -324,11 +324,11 @@ func (c *Client) PoolStats() *PoolStats {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client) Pipelined(fn func(*Pipeline) error) ([]Cmder, error) {
|
||||
func (c *Client) Pipelined(fn func(Pipelineable) error) ([]Cmder, error) {
|
||||
return c.Pipeline().pipelined(fn)
|
||||
}
|
||||
|
||||
func (c *Client) Pipeline() *Pipeline {
|
||||
func (c *Client) Pipeline() Pipelineable {
|
||||
pipe := Pipeline{
|
||||
exec: c.pipelineExecer(c.pipelineProcessCmds),
|
||||
}
|
||||
@ -337,7 +337,7 @@ func (c *Client) Pipeline() *Pipeline {
|
||||
return &pipe
|
||||
}
|
||||
|
||||
func (c *Client) TxPipelined(fn func(*Pipeline) error) ([]Cmder, error) {
|
||||
func (c *Client) TxPipelined(fn func(Pipelineable) error) ([]Cmder, error) {
|
||||
return c.TxPipeline().pipelined(fn)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user