Skip to content

Commit 6ecbed7

Browse files
committed
Pipeliner expose queued commands
Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
1 parent ff4d63e commit 6ecbed7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pipeline.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ type Pipeliner interface {
3838

3939
// Exec is to send all the commands buffered in the pipeline to the redis-server.
4040
Exec(ctx context.Context) ([]Cmder, error)
41+
42+
// Cmds returns the list of queued commands.
43+
Cmds() []Cmder
4144
}
4245

4346
var _ Pipeliner = (*Pipeline)(nil)
@@ -119,3 +122,7 @@ func (c *Pipeline) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([
119122
func (c *Pipeline) TxPipeline() Pipeliner {
120123
return c
121124
}
125+
126+
func (c *Pipeline) Cmds() []Cmder {
127+
return c.cmds
128+
}

0 commit comments

Comments
 (0)