1
0
mirror of https://github.com/redis/go-redis.git synced 2025-12-25 00:01:00 +03:00

Add ClusterPipeline.

This commit is contained in:
Vladimir Mihailenco
2015-03-18 12:41:24 +02:00
parent 5c951b37d5
commit 99fe9114b1
9 changed files with 310 additions and 104 deletions

View File

@@ -5,6 +5,23 @@ import (
. "github.com/onsi/gomega"
)
// GetSlot returns the cached slot addresses
func (c *ClusterClient) GetSlot(pos int) []string {
c.slotsMx.RLock()
defer c.slotsMx.RUnlock()
return c.slots[pos]
}
// SwapSlot swaps a slot's master/slave address
// for testing MOVED redirects
func (c *ClusterClient) SwapSlot(pos int) []string {
c.slotsMx.Lock()
defer c.slotsMx.Unlock()
c.slots[pos][0], c.slots[pos][1] = c.slots[pos][1], c.slots[pos][0]
return c.slots[pos]
}
var _ = Describe("ClusterClient", func() {
var subject *ClusterClient