Skip to content

Commit

Permalink
feat: add Pipeline to rueidiscompat (#599)
Browse files Browse the repository at this point in the history
* feat: add Pipeline to rueidiscompat

Signed-off-by: Rueian <[email protected]>

* test: add Pipeline to rueidiscompat

Signed-off-by: Rueian <[email protected]>

---------

Signed-off-by: Rueian <[email protected]>
  • Loading branch information
rueian committed Aug 11, 2024
1 parent 97bb0e5 commit 44c7724
Show file tree
Hide file tree
Showing 4 changed files with 3,505 additions and 267 deletions.
11 changes: 11 additions & 0 deletions valkeycompat/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ type ProbabilisticCmdable interface {
Subscribe(ctx context.Context, channels ...string) PubSub
PSubscribe(ctx context.Context, patterns ...string) PubSub
SSubscribe(ctx context.Context, channels ...string) PubSub

Pipeline() Pipeliner
Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
}

// Align with go-redis
Expand Down Expand Up @@ -4617,6 +4620,14 @@ func (c *Compat) PSubscribe(ctx context.Context, patterns ...string) PubSub {
return p
}

func (c *Compat) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) {
return newPipeline(c.client).Pipelined(ctx, fn)
}

func (c *Compat) Pipeline() Pipeliner {
return newPipeline(c.client)
}

func (c CacheCompat) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd {
var resp valkey.ValkeyResult
if bitCount == nil {
Expand Down
Loading

0 comments on commit 44c7724

Please sign in to comment.