redic-cluster 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redic/cluster.rb +12 -7
- data/redic-cluster.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe69acb862b90cf7877fbbd3d18fd597d46b726f
|
4
|
+
data.tar.gz: 88b65f0981a4ad2b0bcbe8c90fe0403f2e0d8e2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72f9572c31e1bbe650acfca48c33477305f5dc017e0af4ab51d94955d6cd6e1d620f4e981d2d4c91852c6498d8dfcd1ec408367820a63cfaad68e9bf7f5858c4
|
7
|
+
data.tar.gz: 250854ef01df85c566cd896e8aecb7086abf78e164e681698f30f07d0c5a9059fd0ac2daf78ac359caf1c4c1019df97fd71df2f52f6dc745b4f6ed64df22ae7f
|
data/lib/redic/cluster.rb
CHANGED
@@ -7,15 +7,12 @@ class Redic::Cluster
|
|
7
7
|
|
8
8
|
def initialize(url="redis://localhost:12001", timeout=10_000_000)
|
9
9
|
@url = url
|
10
|
-
@node = Redic
|
10
|
+
@node = Redic.new(url, timeout)
|
11
11
|
@debug = false
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(*args)
|
15
|
-
res = @node.
|
16
|
-
@node.write(args)
|
17
|
-
@node.read
|
18
|
-
end
|
15
|
+
res = @node.call(*args)
|
19
16
|
|
20
17
|
return res unless res.is_a?(RuntimeError)
|
21
18
|
|
@@ -26,13 +23,21 @@ class Redic::Cluster
|
|
26
23
|
|
27
24
|
$stderr.puts "-> Redirected to slot [#{slot}] located at #{addr}" if @debug
|
28
25
|
|
29
|
-
@node.
|
26
|
+
@node.call("QUIT")
|
30
27
|
|
31
|
-
@node = Redic
|
28
|
+
@node = Redic.new("redis://#{addr}", @node.timeout)
|
32
29
|
|
33
30
|
call(*args)
|
34
31
|
else
|
35
32
|
res
|
36
33
|
end
|
37
34
|
end
|
35
|
+
|
36
|
+
def queue(*args)
|
37
|
+
@node.queue(*args)
|
38
|
+
end
|
39
|
+
|
40
|
+
def commit
|
41
|
+
@node.commit
|
42
|
+
end
|
38
43
|
end
|
data/redic-cluster.gemspec
CHANGED