File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,12 @@ type Pipeliner interface {
3030 // If a certain Redis command is not yet supported, you can use Do to execute it.
3131 Do (ctx context.Context , args ... interface {}) * Cmd
3232
33- // Process puts the commands to be executed into the pipeline buffer .
33+ // Process queues the cmd for later execution .
3434 Process (ctx context.Context , cmd Cmder ) error
3535
36+ // BatchProcess adds multiple commands to be executed into the pipeline buffer.
37+ BatchProcess (ctx context.Context , cmd ... Cmder ) error
38+
3639 // Discard discards all commands in the pipeline buffer that have not yet been executed.
3740 Discard ()
3841
@@ -79,7 +82,12 @@ func (c *Pipeline) Do(ctx context.Context, args ...interface{}) *Cmd {
7982
8083// Process queues the cmd for later execution.
8184func (c * Pipeline ) Process (ctx context.Context , cmd Cmder ) error {
82- c .cmds = append (c .cmds , cmd )
85+ return c .BatchProcess (ctx , cmd )
86+ }
87+
88+ // BatchProcess queues multiple cmds for later execution.
89+ func (c * Pipeline ) BatchProcess (ctx context.Context , cmd ... Cmder ) error {
90+ c .cmds = append (c .cmds , cmd ... )
8391 return nil
8492}
8593
You can’t perform that action at this time.
0 commit comments