mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Review API.
This commit is contained in:
10
pipeline.go
10
pipeline.go
@ -16,6 +16,16 @@ func (c *Client) PipelineClient() (*PipelineClient, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *Client) Pipelined(do func(*PipelineClient)) ([]Req, error) {
|
||||
pc, err := c.PipelineClient()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer pc.Close()
|
||||
do(pc)
|
||||
return pc.RunQueued()
|
||||
}
|
||||
|
||||
func (c *PipelineClient) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user