1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Reuse single Pipeline type in Client, ClusterClient and Ring.

This commit is contained in:
Vladimir Mihailenco
2016-04-09 10:47:15 +03:00
parent b351402995
commit 3b051d2374
7 changed files with 150 additions and 247 deletions

View File

@ -96,7 +96,7 @@ var _ = Describe("Redis ring", func() {
Describe("pipelining", func() {
It("returns an error when all shards are down", func() {
ring := redis.NewRing(&redis.RingOptions{})
_, err := ring.Pipelined(func(pipe *redis.RingPipeline) error {
_, err := ring.Pipelined(func(pipe *redis.Pipeline) error {
pipe.Ping()
return nil
})
@ -133,7 +133,7 @@ var _ = Describe("Redis ring", func() {
keys = append(keys, string(key))
}
_, err := ring.Pipelined(func(pipe *redis.RingPipeline) error {
_, err := ring.Pipelined(func(pipe *redis.Pipeline) error {
for _, key := range keys {
pipe.Set(key, "value", 0).Err()
}
@ -149,7 +149,7 @@ var _ = Describe("Redis ring", func() {
})
It("supports hash tags", func() {
_, err := ring.Pipelined(func(pipe *redis.RingPipeline) error {
_, err := ring.Pipelined(func(pipe *redis.Pipeline) error {
for i := 0; i < 100; i++ {
pipe.Set(fmt.Sprintf("key%d{tag}", i), "value", 0).Err()
}