redis-cluster-client 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/redis_client/cluster/node.rb +1 -0
- data/lib/redis_client/cluster/transaction.rb +13 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7986c9cc2ea7af5a128397b327e1a4b001740ac6a49af09d8f3ed507665b39d9
|
4
|
+
data.tar.gz: fcb8ef4cbc7095b8b57f9570b24dd4dc4d9b4a517b0e9d2451aa9c740c676989
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2624fa1a7ff96f625816beb5f53cac2727c1649f44cb4170f2c744b60f8f4b03eb4ba764cfaba41d867f73807b24965c3fbd2938b3875d0cabf37ccf69bcf32
|
7
|
+
data.tar.gz: b062efff7fea22cda0379c8749c00315d949ad82d491b93307f3c8f42f2af0b563d3af270a1c63bb7b497c9e826f33369618e5dd93fe58415b6097eea9f600b9
|
@@ -8,6 +8,7 @@ class RedisClient
|
|
8
8
|
class Transaction
|
9
9
|
ConsistencyError = Class.new(::RedisClient::Error)
|
10
10
|
MAX_REDIRECTION = 2
|
11
|
+
EMPTY_ARRAY = [].freeze
|
11
12
|
|
12
13
|
def initialize(router, command_builder, node: nil, slot: nil, asking: false)
|
13
14
|
@router = router
|
@@ -62,10 +63,10 @@ class RedisClient
|
|
62
63
|
def execute
|
63
64
|
@pending_commands.each(&:call)
|
64
65
|
|
65
|
-
|
66
|
+
return EMPTY_ARRAY if @pipeline._empty?
|
66
67
|
raise ConsistencyError, "couldn't determine the node: #{@pipeline._commands}" if @node.nil?
|
67
68
|
|
68
|
-
|
69
|
+
commit
|
69
70
|
end
|
70
71
|
|
71
72
|
private
|
@@ -92,8 +93,17 @@ class RedisClient
|
|
92
93
|
@pending_commands.clear
|
93
94
|
end
|
94
95
|
|
95
|
-
def
|
96
|
+
def commit
|
96
97
|
@pipeline.call('EXEC')
|
98
|
+
settle
|
99
|
+
end
|
100
|
+
|
101
|
+
def cancel
|
102
|
+
@pipeline.call('DISCARD')
|
103
|
+
settle
|
104
|
+
end
|
105
|
+
|
106
|
+
def settle
|
97
107
|
# If we needed ASKING on the watch, we need ASKING on the multi as well.
|
98
108
|
@node.call('ASKING') if @asking
|
99
109
|
# Don't handle redirections at this level if we're in a watch (the watcher handles redirections
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-cluster-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taishi Kasuga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-client
|