redis_queued_locks 1.20.0 → 1.22.0
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/.claude/project-overview.md +249 -36
- data/.claude/rules/acquirer.md +16 -14
- data/.claude/rules/arguments.md +2 -2
- data/.claude/rules/changelog.md +27 -0
- data/.claude/rules/git.md +1 -1
- data/.claude/rules/logic.md +34 -13
- data/.claude/rules/swarm.md +4 -5
- data/.claude/rules/tests.md +9 -6
- data/.claude/rules/type-checking.md +13 -14
- data/.claude/rules/visitors.md +13 -14
- data/.claude/skills/rql-code-review/SKILL.md +134 -43
- data/CHANGELOG.md +105 -125
- data/CLAUDE.md +11 -9
- data/README.md +501 -136
- data/Rakefile +11 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +1 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +68 -10
- data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +82 -15
- data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +92 -14
- data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb +441 -63
- data/lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb +2 -2
- data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb +1 -0
- data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb +5 -5
- data/lib/redis_queued_locks/acquirer/acquire_lock.rb +176 -39
- data/lib/redis_queued_locks/acquirer/clear_dead_requests.rb +322 -49
- data/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb +125 -13
- data/lib/redis_queued_locks/acquirer/is_locked.rb +0 -1
- data/lib/redis_queued_locks/acquirer/is_queued.rb +0 -1
- data/lib/redis_queued_locks/acquirer/keys.rb +16 -3
- data/lib/redis_queued_locks/acquirer/lock_info.rb +31 -39
- data/lib/redis_queued_locks/acquirer/lock_series_poc/instr_visitor.rb +11 -5
- data/lib/redis_queued_locks/acquirer/lock_series_poc/log_visitor.rb +20 -10
- data/lib/redis_queued_locks/acquirer/lock_series_poc.rb +105 -36
- data/lib/redis_queued_locks/acquirer/locks.rb +32 -11
- data/lib/redis_queued_locks/acquirer/queue_info.rb +30 -8
- data/lib/redis_queued_locks/acquirer/queues.rb +26 -6
- data/lib/redis_queued_locks/acquirer/reindex_locks.rb +117 -4
- data/lib/redis_queued_locks/acquirer/release_all_locks.rb +37 -6
- data/lib/redis_queued_locks/acquirer/release_lock.rb +33 -7
- data/lib/redis_queued_locks/acquirer/release_locks_of.rb +45 -6
- data/lib/redis_queued_locks/acquirer/release_read_lock.rb +22 -3
- data/lib/redis_queued_locks/client.rb +140 -56
- data/lib/redis_queued_locks/config.rb +105 -14
- data/lib/redis_queued_locks/errors.rb +34 -4
- data/lib/redis_queued_locks/instrument/sampler.rb +4 -7
- data/lib/redis_queued_locks/logging/sampler.rb +4 -8
- data/lib/redis_queued_locks/resource.rb +137 -12
- data/lib/redis_queued_locks/swarm/flush_zombies.rb +1 -0
- data/lib/redis_queued_locks/swarm/redis_client_builder.rb +8 -4
- data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +8 -6
- data/lib/redis_queued_locks/swarm/zombie_info.rb +6 -2
- data/lib/redis_queued_locks/swarm.rb +86 -5
- data/lib/redis_queued_locks/utilities.rb +1 -1
- data/lib/redis_queued_locks/version.rb +2 -2
- data/rbs_collection.lock.yaml +4 -0
- data/rbs_collection.yaml +2 -1
- data/sig/manifest.yml +1 -0
- data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs +2 -2
- data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs +2 -2
- data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +25 -5
- data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +32 -12
- data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs +61 -40
- data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs +59 -11
- data/sig/redis_queued_locks/acquirer/acquire_lock/{yield_with_expire → yield_expire}/log_visitor.rbs +4 -4
- data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +4 -4
- data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +6 -4
- data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +23 -1
- data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +16 -3
- data/sig/redis_queued_locks/acquirer/queues.rbs +1 -1
- data/sig/redis_queued_locks/acquirer/reindex_locks.rbs +22 -1
- data/sig/redis_queued_locks/acquirer/release_lock.rbs +3 -2
- data/sig/redis_queued_locks/acquirer/release_read_lock.rbs +1 -1
- data/sig/redis_queued_locks/client.rbs +24 -10
- data/sig/redis_queued_locks/config.rbs +54 -1
- data/sig/redis_queued_locks/errors.rbs +5 -2
- data/sig/redis_queued_locks/instrument/sampler.rbs +3 -3
- data/sig/redis_queued_locks/instrument/void_notifier.rbs +3 -1
- data/sig/redis_queued_locks/logging/sampler.rbs +3 -3
- data/sig/redis_queued_locks/resource.rbs +23 -13
- data/sig/redis_queued_locks/swarm/swarm_element/threaded.rbs +1 -1
- data/sig/redis_queued_locks/utilities.rbs +2 -1
- data/sig/redis_queued_locks.rbs +7 -0
- data/sig/vendor/redis_client.rbs +1 -0
- metadata +4 -3
- /data/sig/redis_queued_locks/{acquier.rbs → acquirer.rbs} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# @api public
|
|
4
4
|
# @since 1.9.0
|
|
5
|
+
# @version 1.13.0
|
|
5
6
|
# rubocop:disable Metrics/ClassLength
|
|
6
7
|
class RedisQueuedLocks::Swarm
|
|
7
8
|
require_relative 'swarm/redis_client_builder'
|
|
@@ -76,7 +77,16 @@ class RedisQueuedLocks::Swarm
|
|
|
76
77
|
#
|
|
77
78
|
# @api public
|
|
78
79
|
# @since 1.9.0
|
|
80
|
+
# @version 1.21.0
|
|
79
81
|
def swarm_info(zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'])
|
|
82
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
83
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
84
|
+
raise(
|
|
85
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
86
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
|
|
80
90
|
RedisQueuedLocks::Swarm::Acquirers.acquirers(
|
|
81
91
|
rql_client.redis_client,
|
|
82
92
|
zombie_ttl
|
|
@@ -104,12 +114,32 @@ class RedisQueuedLocks::Swarm
|
|
|
104
114
|
#
|
|
105
115
|
# @api public
|
|
106
116
|
# @since 1.9.0
|
|
107
|
-
# @version 1.
|
|
117
|
+
# @version 1.21.0
|
|
108
118
|
def flush_zombies(
|
|
109
119
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
110
120
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size'],
|
|
111
121
|
queue_scan_size: rql_client.config['swarm.flush_zombies.zombie_queue_scan_size']
|
|
112
122
|
)
|
|
123
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
124
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
125
|
+
raise(
|
|
126
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
127
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
131
|
+
raise(
|
|
132
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
133
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
if !queue_scan_size.is_a?(::Integer) || queue_scan_size <= 0
|
|
137
|
+
raise(
|
|
138
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
139
|
+
"`:queue_scan_size` argument should be a positive Integer, got #{queue_scan_size.inspect}."
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
113
143
|
RedisQueuedLocks::Swarm::FlushZombies.flush_zombies(
|
|
114
144
|
rql_client.redis_client,
|
|
115
145
|
zombie_ttl,
|
|
@@ -125,11 +155,25 @@ class RedisQueuedLocks::Swarm
|
|
|
125
155
|
#
|
|
126
156
|
# @api public
|
|
127
157
|
# @since 1.9.0
|
|
128
|
-
# @version 1.
|
|
158
|
+
# @version 1.21.0
|
|
129
159
|
def zombie_locks(
|
|
130
160
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
131
161
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size']
|
|
132
162
|
)
|
|
163
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
164
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
165
|
+
raise(
|
|
166
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
167
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
171
|
+
raise(
|
|
172
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
173
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
133
177
|
RedisQueuedLocks::Swarm::ZombieInfo.zombie_locks(
|
|
134
178
|
rql_client.redis_client,
|
|
135
179
|
zombie_ttl,
|
|
@@ -142,13 +186,27 @@ class RedisQueuedLocks::Swarm
|
|
|
142
186
|
# @option lock_scan_size [Integer]
|
|
143
187
|
# @return [Set<String>]
|
|
144
188
|
#
|
|
145
|
-
# @api
|
|
189
|
+
# @api public
|
|
146
190
|
# @since 1.9.0
|
|
147
|
-
# @version 1.
|
|
191
|
+
# @version 1.21.0
|
|
148
192
|
def zombie_acquirers(
|
|
149
193
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
150
194
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size']
|
|
151
195
|
)
|
|
196
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
197
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
198
|
+
raise(
|
|
199
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
200
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
204
|
+
raise(
|
|
205
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
206
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
|
|
152
210
|
RedisQueuedLocks::Swarm::ZombieInfo.zombie_acquirers(
|
|
153
211
|
rql_client.redis_client,
|
|
154
212
|
zombie_ttl,
|
|
@@ -162,7 +220,16 @@ class RedisQueuedLocks::Swarm
|
|
|
162
220
|
#
|
|
163
221
|
# @api public
|
|
164
222
|
# @since 1.9.0
|
|
223
|
+
# @version 1.21.0
|
|
165
224
|
def zombie_hosts(zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'])
|
|
225
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
226
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
227
|
+
raise(
|
|
228
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
229
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
|
|
166
233
|
RedisQueuedLocks::Swarm::ZombieInfo.zombie_hosts(rql_client.redis_client, zombie_ttl)
|
|
167
234
|
end
|
|
168
235
|
|
|
@@ -172,11 +239,25 @@ class RedisQueuedLocks::Swarm
|
|
|
172
239
|
#
|
|
173
240
|
# @api public
|
|
174
241
|
# @since 1.9.0
|
|
175
|
-
# @version 1.
|
|
242
|
+
# @version 1.21.0
|
|
176
243
|
def zombies_info(
|
|
177
244
|
zombie_ttl: rql_client.config['swarm.flush_zombies.zombie_ttl'],
|
|
178
245
|
lock_scan_size: rql_client.config['swarm.flush_zombies.zombie_lock_scan_size']
|
|
179
246
|
)
|
|
247
|
+
# NOTE: (arguments) the same ranges as the config keys;
|
|
248
|
+
if !zombie_ttl.is_a?(::Integer) || zombie_ttl <= 0
|
|
249
|
+
raise(
|
|
250
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
251
|
+
"`:zombie_ttl` argument should be a positive Integer, got #{zombie_ttl.inspect}."
|
|
252
|
+
)
|
|
253
|
+
end
|
|
254
|
+
if !lock_scan_size.is_a?(::Integer) || lock_scan_size <= 0
|
|
255
|
+
raise(
|
|
256
|
+
RedisQueuedLocks::SwarmArgumentError,
|
|
257
|
+
"`:lock_scan_size` argument should be a positive Integer, got #{lock_scan_size.inspect}."
|
|
258
|
+
)
|
|
259
|
+
end
|
|
260
|
+
|
|
180
261
|
RedisQueuedLocks::Swarm::ZombieInfo.zombies_info(
|
|
181
262
|
rql_client.redis_client,
|
|
182
263
|
zombie_ttl,
|
data/rbs_collection.lock.yaml
CHANGED
data/rbs_collection.yaml
CHANGED
|
@@ -2,7 +2,7 @@ sources:
|
|
|
2
2
|
- type: git
|
|
3
3
|
name: ruby/gem_rbs_collection
|
|
4
4
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
5
|
-
revision:
|
|
5
|
+
revision: c69c75ba79d7c19870f8d0e6fa7fe2c1d356e5ae # NOTE: pinned for reproducible checks; bump deliberately (`bundle exec rbs collection update`)
|
|
6
6
|
repo_dir: gems
|
|
7
7
|
|
|
8
8
|
path: .gem_rbs_collection
|
|
@@ -13,3 +13,4 @@ gems:
|
|
|
13
13
|
- name: timeout
|
|
14
14
|
- name: logger
|
|
15
15
|
- name: monitor
|
|
16
|
+
- name: json # NOTE: used by the runtime type checking only, not by the library code
|
data/sig/manifest.yml
CHANGED
|
@@ -9,13 +9,13 @@ module RedisQueuedLocks
|
|
|
9
9
|
RC::client redis,
|
|
10
10
|
RQL::loggerObj logger,
|
|
11
11
|
String lock_key,
|
|
12
|
-
|
|
12
|
+
RQL::readWriteMode read_write_mode,
|
|
13
13
|
String lock_key_queue,
|
|
14
14
|
String read_lock_key_queue,
|
|
15
15
|
Integer queue_ttl,
|
|
16
16
|
String acquirer_id,
|
|
17
17
|
String host_id,
|
|
18
|
-
|
|
18
|
+
RQL::accessStrategy access_strategy,
|
|
19
19
|
bool log_sampled,
|
|
20
20
|
bool instr_sampled
|
|
21
21
|
) -> { ok: bool, result: Integer }
|
|
@@ -8,7 +8,8 @@ module RedisQueuedLocks
|
|
|
8
8
|
RQL::instrObj instrumenter,
|
|
9
9
|
bool instr_sampled,
|
|
10
10
|
String lock_key,
|
|
11
|
-
|
|
11
|
+
RQL::readWriteMode rw_mode,
|
|
12
|
+
Integer priority,
|
|
12
13
|
Integer? ttl,
|
|
13
14
|
String acq_id,
|
|
14
15
|
String hst_id,
|
|
@@ -21,7 +22,8 @@ module RedisQueuedLocks
|
|
|
21
22
|
RQL::instrObj instrumenter,
|
|
22
23
|
bool instr_sampled,
|
|
23
24
|
String lock_key,
|
|
24
|
-
|
|
25
|
+
RQL::readWriteMode rw_mode,
|
|
26
|
+
Integer priority,
|
|
25
27
|
Integer? ttl,
|
|
26
28
|
String acq_id,
|
|
27
29
|
String hst_id,
|
|
@@ -34,7 +36,8 @@ module RedisQueuedLocks
|
|
|
34
36
|
RQL::instrObj instrumenter,
|
|
35
37
|
bool instr_sampled,
|
|
36
38
|
String lock_key,
|
|
37
|
-
|
|
39
|
+
RQL::readWriteMode rw_mode,
|
|
40
|
+
Integer priority,
|
|
38
41
|
Integer? ttl,
|
|
39
42
|
String acq_id,
|
|
40
43
|
String hst_id,
|
|
@@ -47,7 +50,8 @@ module RedisQueuedLocks
|
|
|
47
50
|
RQL::instrObj instrumenter,
|
|
48
51
|
bool instr_sampled,
|
|
49
52
|
String lock_key,
|
|
50
|
-
|
|
53
|
+
RQL::readWriteMode rw_mode,
|
|
54
|
+
Integer priority,
|
|
51
55
|
Integer? ttl,
|
|
52
56
|
String acq_id,
|
|
53
57
|
String hst_id,
|
|
@@ -61,7 +65,8 @@ module RedisQueuedLocks
|
|
|
61
65
|
RQL::instrObj instrumenter,
|
|
62
66
|
bool instr_sampled,
|
|
63
67
|
String lock_key,
|
|
64
|
-
|
|
68
|
+
RQL::readWriteMode rw_mode,
|
|
69
|
+
Integer priority,
|
|
65
70
|
Integer? ttl,
|
|
66
71
|
String acq_id,
|
|
67
72
|
String hst_id,
|
|
@@ -70,6 +75,21 @@ module RedisQueuedLocks
|
|
|
70
75
|
Integer|Float hold_time,
|
|
71
76
|
untyped? instrument
|
|
72
77
|
) -> void
|
|
78
|
+
|
|
79
|
+
def self.lock_obtaining_failed: (
|
|
80
|
+
RQL::instrObj instrumenter,
|
|
81
|
+
bool instr_sampled,
|
|
82
|
+
String lock_key,
|
|
83
|
+
RQL::readWriteMode rw_mode,
|
|
84
|
+
Integer priority,
|
|
85
|
+
Integer ttl,
|
|
86
|
+
String acq_id,
|
|
87
|
+
String hst_id,
|
|
88
|
+
Integer|Float ts,
|
|
89
|
+
Integer|Float acq_time,
|
|
90
|
+
Symbol result,
|
|
91
|
+
untyped? instrument
|
|
92
|
+
) -> void
|
|
73
93
|
end
|
|
74
94
|
end
|
|
75
95
|
end
|
|
@@ -11,8 +11,9 @@ module RedisQueuedLocks
|
|
|
11
11
|
Integer queue_ttl,
|
|
12
12
|
String acquirer_id,
|
|
13
13
|
String host_id,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
RQL::accessStrategy access_strategy,
|
|
15
|
+
RQL::readWriteMode rw_mode,
|
|
16
|
+
Integer priority
|
|
16
17
|
) -> void
|
|
17
18
|
|
|
18
19
|
def self.start_try_to_lock_cycle: (
|
|
@@ -22,8 +23,9 @@ module RedisQueuedLocks
|
|
|
22
23
|
Integer queue_ttl,
|
|
23
24
|
String acquirer_id,
|
|
24
25
|
String host_id,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
RQL::accessStrategy access_strategy,
|
|
27
|
+
RQL::readWriteMode rw_mode,
|
|
28
|
+
Integer priority
|
|
27
29
|
) -> void
|
|
28
30
|
|
|
29
31
|
def self.dead_score_reached__reset_acquirer_position: (
|
|
@@ -33,8 +35,9 @@ module RedisQueuedLocks
|
|
|
33
35
|
Integer queue_ttl,
|
|
34
36
|
String acquirer_id,
|
|
35
37
|
String host_id,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
RQL::accessStrategy access_strategy,
|
|
39
|
+
RQL::readWriteMode rw_mode,
|
|
40
|
+
Integer priority
|
|
38
41
|
) -> void
|
|
39
42
|
|
|
40
43
|
def self.extendable_reentrant_lock_obtained: (
|
|
@@ -45,8 +48,9 @@ module RedisQueuedLocks
|
|
|
45
48
|
String acquirer_id,
|
|
46
49
|
String host_id,
|
|
47
50
|
Integer|Float acq_time,
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
RQL::accessStrategy access_strategy,
|
|
52
|
+
RQL::readWriteMode rw_mode,
|
|
53
|
+
Integer priority
|
|
50
54
|
) -> void
|
|
51
55
|
|
|
52
56
|
def self.reentrant_lock_obtained: (
|
|
@@ -57,8 +61,9 @@ module RedisQueuedLocks
|
|
|
57
61
|
String acquirer_id,
|
|
58
62
|
String host_id,
|
|
59
63
|
Integer|Float acq_time,
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
RQL::accessStrategy access_strategy,
|
|
65
|
+
RQL::readWriteMode rw_mode,
|
|
66
|
+
Integer priority
|
|
62
67
|
) -> void
|
|
63
68
|
|
|
64
69
|
def self.lock_obtained: (
|
|
@@ -69,8 +74,23 @@ module RedisQueuedLocks
|
|
|
69
74
|
String acquirer_id,
|
|
70
75
|
String host_id,
|
|
71
76
|
Integer|Float acq_time,
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
RQL::accessStrategy access_strategy,
|
|
78
|
+
RQL::readWriteMode rw_mode,
|
|
79
|
+
Integer priority
|
|
80
|
+
) -> void
|
|
81
|
+
|
|
82
|
+
def self.lock_obtaining_failed: (
|
|
83
|
+
RQL::loggerObj logger,
|
|
84
|
+
bool log_sampled,
|
|
85
|
+
String lock_key,
|
|
86
|
+
Integer queue_ttl,
|
|
87
|
+
String acquirer_id,
|
|
88
|
+
String host_id,
|
|
89
|
+
Integer|Float acq_time,
|
|
90
|
+
RQL::accessStrategy access_strategy,
|
|
91
|
+
RQL::readWriteMode rw_mode,
|
|
92
|
+
Integer priority,
|
|
93
|
+
Symbol result
|
|
74
94
|
) -> void
|
|
75
95
|
end
|
|
76
96
|
end
|
|
@@ -13,8 +13,8 @@ module RedisQueuedLocks
|
|
|
13
13
|
Integer queue_ttl,
|
|
14
14
|
String acquirer_id,
|
|
15
15
|
String host_id,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
RQL::accessStrategy access_strategy,
|
|
17
|
+
RQL::readWriteMode rw_mode
|
|
18
18
|
) -> void
|
|
19
19
|
|
|
20
20
|
def self.rconn_fetched: (
|
|
@@ -25,8 +25,8 @@ module RedisQueuedLocks
|
|
|
25
25
|
Integer queue_ttl,
|
|
26
26
|
String acquirer_id,
|
|
27
27
|
String host_id,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
RQL::accessStrategy access_strategy,
|
|
29
|
+
RQL::readWriteMode rw_mode
|
|
30
30
|
) -> void
|
|
31
31
|
|
|
32
32
|
def self.same_process_conflict_detected: (
|
|
@@ -37,8 +37,8 @@ module RedisQueuedLocks
|
|
|
37
37
|
Integer queue_ttl,
|
|
38
38
|
String acquirer_id,
|
|
39
39
|
String host_id,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
RQL::accessStrategy access_strategy,
|
|
41
|
+
RQL::readWriteMode rw_mode
|
|
42
42
|
) -> void
|
|
43
43
|
|
|
44
44
|
def self.same_process_conflict_analyzed: (
|
|
@@ -49,8 +49,8 @@ module RedisQueuedLocks
|
|
|
49
49
|
Integer queue_ttl,
|
|
50
50
|
String acquirer_id,
|
|
51
51
|
String host_id,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
RQL::accessStrategy access_strategy,
|
|
53
|
+
RQL::readWriteMode rw_mode,
|
|
54
54
|
Symbol sp_conflict_status
|
|
55
55
|
) -> void
|
|
56
56
|
|
|
@@ -62,8 +62,8 @@ module RedisQueuedLocks
|
|
|
62
62
|
Integer queue_ttl,
|
|
63
63
|
String acquirer_id,
|
|
64
64
|
String host_id,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
RQL::accessStrategy access_strategy,
|
|
66
|
+
RQL::readWriteMode rw_mode,
|
|
67
67
|
Symbol sp_conflict_status,
|
|
68
68
|
Integer? ttl,
|
|
69
69
|
::Float spc_processed_timestamp
|
|
@@ -77,8 +77,8 @@ module RedisQueuedLocks
|
|
|
77
77
|
Integer queue_ttl,
|
|
78
78
|
String acquirer_id,
|
|
79
79
|
String host_id,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
RQL::accessStrategy access_strategy,
|
|
81
|
+
RQL::readWriteMode rw_mode,
|
|
82
82
|
Symbol sp_conflict_status,
|
|
83
83
|
::Float spc_processed_timestamp
|
|
84
84
|
) -> void
|
|
@@ -91,8 +91,8 @@ module RedisQueuedLocks
|
|
|
91
91
|
Integer queue_ttl,
|
|
92
92
|
String acquirer_id,
|
|
93
93
|
String host_id,
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
RQL::accessStrategy access_strategy,
|
|
95
|
+
RQL::readWriteMode rw_mode,
|
|
96
96
|
Symbol sp_conflict_status,
|
|
97
97
|
::Float spc_processed_timestamp
|
|
98
98
|
) -> void
|
|
@@ -105,8 +105,8 @@ module RedisQueuedLocks
|
|
|
105
105
|
Integer queue_ttl,
|
|
106
106
|
String acquirer_id,
|
|
107
107
|
String host_id,
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
RQL::accessStrategy access_strategy,
|
|
109
|
+
RQL::readWriteMode rw_mode,
|
|
110
110
|
Symbol sp_conflict_status,
|
|
111
111
|
::Float spc_processed_timestamp
|
|
112
112
|
) -> void
|
|
@@ -119,8 +119,9 @@ module RedisQueuedLocks
|
|
|
119
119
|
Integer queue_ttl,
|
|
120
120
|
String acquirer_id,
|
|
121
121
|
String host_id,
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
RQL::accessStrategy access_strategy,
|
|
123
|
+
RQL::readWriteMode rw_mode,
|
|
124
|
+
Integer priority
|
|
124
125
|
) -> void
|
|
125
126
|
|
|
126
127
|
def self.remove_expired_acqs: (
|
|
@@ -131,8 +132,22 @@ module RedisQueuedLocks
|
|
|
131
132
|
Integer queue_ttl,
|
|
132
133
|
String acquirer_id,
|
|
133
134
|
String host_id,
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
RQL::accessStrategy access_strategy,
|
|
136
|
+
RQL::readWriteMode rw_mode
|
|
137
|
+
) -> void
|
|
138
|
+
|
|
139
|
+
def self.dead_request_removed: (
|
|
140
|
+
RQL::loggerObj logger,
|
|
141
|
+
bool log_sampled,
|
|
142
|
+
bool log_lock_try,
|
|
143
|
+
String lock_key,
|
|
144
|
+
Integer queue_ttl,
|
|
145
|
+
String acquirer_id,
|
|
146
|
+
String host_id,
|
|
147
|
+
RQL::accessStrategy access_strategy,
|
|
148
|
+
RQL::readWriteMode rw_mode,
|
|
149
|
+
String dead_acquirer,
|
|
150
|
+
Integer dead_priority
|
|
136
151
|
) -> void
|
|
137
152
|
|
|
138
153
|
def self.get_first_from_queue: (
|
|
@@ -143,9 +158,10 @@ module RedisQueuedLocks
|
|
|
143
158
|
Integer queue_ttl,
|
|
144
159
|
String acquirer_id,
|
|
145
160
|
String host_id,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
String? waiting_acquirer
|
|
161
|
+
RQL::accessStrategy access_strategy,
|
|
162
|
+
RQL::readWriteMode rw_mode,
|
|
163
|
+
String? waiting_acquirer,
|
|
164
|
+
Integer? waiting_priority
|
|
149
165
|
) -> void
|
|
150
166
|
|
|
151
167
|
def self.exit__queue_ttl_reached: (
|
|
@@ -156,8 +172,8 @@ module RedisQueuedLocks
|
|
|
156
172
|
Integer queue_ttl,
|
|
157
173
|
String acquirer_id,
|
|
158
174
|
String host_id,
|
|
159
|
-
|
|
160
|
-
|
|
175
|
+
RQL::accessStrategy access_strategy,
|
|
176
|
+
RQL::readWriteMode rw_mode
|
|
161
177
|
) -> void
|
|
162
178
|
|
|
163
179
|
def self.exit__no_first: (
|
|
@@ -168,9 +184,10 @@ module RedisQueuedLocks
|
|
|
168
184
|
Integer queue_ttl,
|
|
169
185
|
String acquirer_id,
|
|
170
186
|
String host_id,
|
|
171
|
-
|
|
172
|
-
|
|
187
|
+
RQL::accessStrategy access_strategy,
|
|
188
|
+
RQL::readWriteMode rw_mode,
|
|
173
189
|
String? waiting_acquirer,
|
|
190
|
+
Integer? waiting_priority,
|
|
174
191
|
Hash[String,untyped] current_lock_data
|
|
175
192
|
) -> void
|
|
176
193
|
|
|
@@ -182,9 +199,10 @@ module RedisQueuedLocks
|
|
|
182
199
|
Integer queue_ttl,
|
|
183
200
|
String acquirer_id,
|
|
184
201
|
String host_id,
|
|
185
|
-
|
|
186
|
-
|
|
202
|
+
RQL::accessStrategy access_strategy,
|
|
203
|
+
RQL::readWriteMode rw_mode,
|
|
187
204
|
String? waiting_acquirer,
|
|
205
|
+
Integer? waiting_priority,
|
|
188
206
|
String locked_by_acquirer,
|
|
189
207
|
Hash[String,untyped] current_lock_data
|
|
190
208
|
) -> void
|
|
@@ -197,9 +215,10 @@ module RedisQueuedLocks
|
|
|
197
215
|
Integer queue_ttl,
|
|
198
216
|
String acquirer_id,
|
|
199
217
|
String host_id,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
String ahead_acquirer
|
|
218
|
+
RQL::accessStrategy access_strategy,
|
|
219
|
+
RQL::readWriteMode rw_mode,
|
|
220
|
+
String ahead_acquirer,
|
|
221
|
+
Integer? ahead_priority
|
|
203
222
|
) -> void
|
|
204
223
|
|
|
205
224
|
def self.exit__read_request_ahead: (
|
|
@@ -210,9 +229,10 @@ module RedisQueuedLocks
|
|
|
210
229
|
Integer queue_ttl,
|
|
211
230
|
String acquirer_id,
|
|
212
231
|
String host_id,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
String ahead_acquirer
|
|
232
|
+
RQL::accessStrategy access_strategy,
|
|
233
|
+
RQL::readWriteMode rw_mode,
|
|
234
|
+
String ahead_acquirer,
|
|
235
|
+
Integer? ahead_priority
|
|
216
236
|
) -> void
|
|
217
237
|
|
|
218
238
|
def self.exit__read_lock_still_obtained: (
|
|
@@ -223,9 +243,10 @@ module RedisQueuedLocks
|
|
|
223
243
|
Integer queue_ttl,
|
|
224
244
|
String acquirer_id,
|
|
225
245
|
String host_id,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
String? waiting_acquirer
|
|
246
|
+
RQL::accessStrategy access_strategy,
|
|
247
|
+
RQL::readWriteMode rw_mode,
|
|
248
|
+
String? waiting_acquirer,
|
|
249
|
+
Integer? waiting_priority
|
|
229
250
|
) -> void
|
|
230
251
|
|
|
231
252
|
def self.obtain__free_to_acquire: (
|
|
@@ -236,8 +257,8 @@ module RedisQueuedLocks
|
|
|
236
257
|
Integer queue_ttl,
|
|
237
258
|
String acquirer_id,
|
|
238
259
|
String host_id,
|
|
239
|
-
|
|
240
|
-
|
|
260
|
+
RQL::accessStrategy access_strategy,
|
|
261
|
+
RQL::readWriteMode rw_mode
|
|
241
262
|
) -> void
|
|
242
263
|
end
|
|
243
264
|
end
|