redis_queued_locks 1.21.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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/project-overview.md +216 -25
  3. data/.claude/rules/acquirer.md +6 -5
  4. data/.claude/rules/arguments.md +2 -2
  5. data/.claude/rules/changelog.md +27 -0
  6. data/.claude/rules/git.md +1 -1
  7. data/.claude/rules/logic.md +10 -12
  8. data/.claude/rules/swarm.md +3 -4
  9. data/.claude/rules/tests.md +6 -6
  10. data/.claude/rules/type-checking.md +13 -14
  11. data/.claude/rules/visitors.md +5 -5
  12. data/.claude/skills/rql-code-review/SKILL.md +112 -35
  13. data/CHANGELOG.md +98 -244
  14. data/CLAUDE.md +9 -8
  15. data/README.md +275 -85
  16. data/Rakefile +11 -0
  17. data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +28 -12
  18. data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +38 -16
  19. data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +92 -15
  20. data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb +430 -63
  21. data/lib/redis_queued_locks/acquirer/acquire_lock.rb +72 -22
  22. data/lib/redis_queued_locks/acquirer/clear_dead_requests.rb +240 -45
  23. data/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb +3 -1
  24. data/lib/redis_queued_locks/acquirer/keys.rb +6 -2
  25. data/lib/redis_queued_locks/acquirer/lock_series_poc/instr_visitor.rb +10 -5
  26. data/lib/redis_queued_locks/acquirer/lock_series_poc/log_visitor.rb +18 -9
  27. data/lib/redis_queued_locks/acquirer/lock_series_poc.rb +52 -23
  28. data/lib/redis_queued_locks/acquirer/locks.rb +6 -2
  29. data/lib/redis_queued_locks/acquirer/queue_info.rb +30 -7
  30. data/lib/redis_queued_locks/acquirer/queues.rb +17 -6
  31. data/lib/redis_queued_locks/acquirer/release_all_locks.rb +6 -2
  32. data/lib/redis_queued_locks/acquirer/release_locks_of.rb +6 -2
  33. data/lib/redis_queued_locks/client.rb +66 -24
  34. data/lib/redis_queued_locks/config.rb +93 -1
  35. data/lib/redis_queued_locks/resource.rb +124 -9
  36. data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +6 -5
  37. data/lib/redis_queued_locks/swarm/zombie_info.rb +6 -2
  38. data/lib/redis_queued_locks/version.rb +2 -2
  39. data/rbs_collection.lock.yaml +4 -0
  40. data/rbs_collection.yaml +2 -1
  41. data/sig/manifest.yml +1 -0
  42. data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs +2 -2
  43. data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs +2 -2
  44. data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +12 -6
  45. data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +21 -14
  46. data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs +61 -40
  47. data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs +59 -11
  48. data/sig/redis_queued_locks/acquirer/acquire_lock/{yield_with_expire → yield_expire}/log_visitor.rbs +4 -4
  49. data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +2 -2
  50. data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +5 -3
  51. data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +14 -1
  52. data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +2 -2
  53. data/sig/redis_queued_locks/acquirer/queues.rbs +1 -1
  54. data/sig/redis_queued_locks/client.rbs +10 -7
  55. data/sig/redis_queued_locks/config.rbs +54 -1
  56. data/sig/redis_queued_locks/instrument/sampler.rbs +3 -1
  57. data/sig/redis_queued_locks/instrument/void_notifier.rbs +3 -1
  58. data/sig/redis_queued_locks/logging/sampler.rbs +3 -1
  59. data/sig/redis_queued_locks/resource.rbs +22 -12
  60. data/sig/redis_queued_locks/swarm/swarm_element/threaded.rbs +1 -1
  61. data/sig/redis_queued_locks/utilities.rbs +2 -1
  62. data/sig/redis_queued_locks.rbs +7 -0
  63. metadata +4 -3
  64. /data/sig/redis_queued_locks/{acquier.rbs → acquirer.rbs} +0 -0
@@ -5,6 +5,6 @@ module RedisQueuedLocks
5
5
  #
6
6
  # @api public
7
7
  # @since 0.0.1
8
- # @version 1.21.0
9
- VERSION = '1.21.0'
8
+ # @version 1.22.0
9
+ VERSION = '1.22.0'
10
10
  end
@@ -9,6 +9,10 @@ gems:
9
9
  revision: c69c75ba79d7c19870f8d0e6fa7fe2c1d356e5ae
10
10
  remote: https://github.com/ruby/gem_rbs_collection.git
11
11
  repo_dir: gems
12
+ - name: json
13
+ version: '0'
14
+ source:
15
+ type: stdlib
12
16
  - name: logger
13
17
  version: '1.7'
14
18
  source:
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: main
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
@@ -4,3 +4,4 @@ dependencies:
4
4
  - securerandom
5
5
  - logger
6
6
  - monitor
7
+ - json # NOTE: used by the runtime type checking only, not by the library code
@@ -12,8 +12,8 @@ module RedisQueuedLocks
12
12
  Integer queue_ttl,
13
13
  String acquirer_id,
14
14
  String host_id,
15
- Symbol access_strategy,
16
- Symbol rw_mode
15
+ RQL::accessStrategy access_strategy,
16
+ RQL::readWriteMode rw_mode
17
17
  ) -> void
18
18
  end
19
19
  end
@@ -9,13 +9,13 @@ module RedisQueuedLocks
9
9
  RC::client redis,
10
10
  RQL::loggerObj logger,
11
11
  String lock_key,
12
- Symbol read_write_mode,
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
- Symbol access_strategy,
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
- Symbol rw_mode,
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
- Symbol rw_mode,
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
- Symbol rw_mode,
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
- Symbol rw_mode,
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
- Symbol rw_mode,
68
+ RQL::readWriteMode rw_mode,
69
+ Integer priority,
65
70
  Integer? ttl,
66
71
  String acq_id,
67
72
  String hst_id,
@@ -75,7 +80,8 @@ module RedisQueuedLocks
75
80
  RQL::instrObj instrumenter,
76
81
  bool instr_sampled,
77
82
  String lock_key,
78
- Symbol rw_mode,
83
+ RQL::readWriteMode rw_mode,
84
+ Integer priority,
79
85
  Integer ttl,
80
86
  String acq_id,
81
87
  String hst_id,
@@ -11,8 +11,9 @@ module RedisQueuedLocks
11
11
  Integer queue_ttl,
12
12
  String acquirer_id,
13
13
  String host_id,
14
- Symbol access_strategy,
15
- Symbol rw_mode
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
- Symbol access_strategy,
26
- Symbol rw_mode
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
- Symbol access_strategy,
37
- Symbol rw_mode
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
- Symbol access_strategy,
49
- Symbol rw_mode
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
- Symbol access_strategy,
61
- Symbol rw_mode
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,9 @@ module RedisQueuedLocks
69
74
  String acquirer_id,
70
75
  String host_id,
71
76
  Integer|Float acq_time,
72
- Symbol access_strategy,
73
- Symbol rw_mode
77
+ RQL::accessStrategy access_strategy,
78
+ RQL::readWriteMode rw_mode,
79
+ Integer priority
74
80
  ) -> void
75
81
 
76
82
  def self.lock_obtaining_failed: (
@@ -81,8 +87,9 @@ module RedisQueuedLocks
81
87
  String acquirer_id,
82
88
  String host_id,
83
89
  Integer|Float acq_time,
84
- Symbol access_strategy,
85
- Symbol rw_mode,
90
+ RQL::accessStrategy access_strategy,
91
+ RQL::readWriteMode rw_mode,
92
+ Integer priority,
86
93
  Symbol result
87
94
  ) -> void
88
95
  end
@@ -13,8 +13,8 @@ module RedisQueuedLocks
13
13
  Integer queue_ttl,
14
14
  String acquirer_id,
15
15
  String host_id,
16
- Symbol access_strategy,
17
- Symbol rw_mode
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
- Symbol access_strategy,
29
- Symbol rw_mode
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
- Symbol access_strategy,
41
- Symbol rw_mode
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
- Symbol access_strategy,
53
- Symbol rw_mode,
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
- Symbol access_strategy,
66
- Symbol rw_mode,
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
- Symbol access_strategy,
81
- Symbol rw_mode,
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
- Symbol access_strategy,
95
- Symbol rw_mode,
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
- Symbol access_strategy,
109
- Symbol rw_mode,
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
- Symbol access_strategy,
123
- Symbol rw_mode
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
- Symbol access_strategy,
135
- Symbol rw_mode
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
- Symbol access_strategy,
147
- Symbol rw_mode,
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
- Symbol access_strategy,
160
- Symbol rw_mode
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
- Symbol access_strategy,
172
- Symbol rw_mode,
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
- Symbol access_strategy,
186
- Symbol rw_mode,
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
- Symbol access_strategy,
201
- Symbol rw_mode,
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
- Symbol access_strategy,
214
- Symbol rw_mode,
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
- Symbol access_strategy,
227
- Symbol rw_mode,
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
- Symbol access_strategy,
240
- Symbol rw_mode
260
+ RQL::accessStrategy access_strategy,
261
+ RQL::readWriteMode rw_mode
241
262
  ) -> void
242
263
  end
243
264
  end
@@ -13,6 +13,7 @@ module RedisQueuedLocks
13
13
  LOCK_STATE_QUEUE_REPLIES_AT: Integer
14
14
  QUEUE_HEAD_REPLY: Integer
15
15
  OPPOSITE_QUEUE_HEAD_REPLY: Integer
16
+ MAX_DEAD_REQUEST_REMOVALS: Integer
16
17
 
17
18
  # { ok: bool, result: Symbol }
18
19
  # { ok: bool, result: Symbol }
@@ -25,7 +26,7 @@ module RedisQueuedLocks
25
26
  # hst_id: String,
26
27
  # ts: Integer?,
27
28
  # ttl: Integer?,
28
- # rw_mode: Symbol
29
+ # rw_mode: RQL::readWriteMode
29
30
  # }
30
31
  # }
31
32
 
@@ -34,7 +35,7 @@ module RedisQueuedLocks
34
35
  RQL::loggerObj logger,
35
36
  bool log_lock_try,
36
37
  String lock_key,
37
- Symbol read_write_mode,
38
+ RQL::readWriteMode read_write_mode,
38
39
  String lock_key_queue,
39
40
  String read_lock_key_queue,
40
41
  String lock_readers_key,
@@ -43,13 +44,14 @@ module RedisQueuedLocks
43
44
  String acquirer_id,
44
45
  String host_id,
45
46
  Integer|Float acquirer_position,
47
+ Integer priority,
46
48
  Integer? ttl,
47
49
  Integer queue_ttl,
48
50
  bool lock_index_enabled,
49
51
  Integer lock_index_grace_period,
50
52
  bool fail_fast,
51
- Symbol conflict_strategy,
52
- Symbol access_strategy,
53
+ RQL::conflictStrategy conflict_strategy,
54
+ RQL::accessStrategy access_strategy,
53
55
  Hash[String|Symbol,untyped]? meta,
54
56
  bool retry_attempt,
55
57
  bool log_sampled,
@@ -63,6 +65,7 @@ module RedisQueuedLocks
63
65
  String request_queue,
64
66
  String opposite_request_queue,
65
67
  Integer|Float acquirer_position,
68
+ Integer priority,
66
69
  String acquirer_id,
67
70
  Float acquirer_dead_score,
68
71
  String lock_name,
@@ -71,6 +74,14 @@ module RedisQueuedLocks
71
74
  Integer lock_index_grace_period
72
75
  ) -> void
73
76
 
77
+ def pipeline_dead_requests_removal: (
78
+ RedisClient::Pipeline pipeline,
79
+ String request_queue,
80
+ String opposite_request_queue,
81
+ Float acquirer_dead_score,
82
+ Integer priority
83
+ ) -> void
84
+
74
85
  def pipeline_lock_state: (
75
86
  RedisClient::Pipeline pipeline,
76
87
  String lock_key,
@@ -81,6 +92,7 @@ module RedisQueuedLocks
81
92
  String request_queue,
82
93
  String opposite_request_queue,
83
94
  Integer|Float acquirer_position,
95
+ Integer priority,
84
96
  Float acquirer_dead_score,
85
97
  String lock_name,
86
98
  Integer queue_ttl,
@@ -89,7 +101,7 @@ module RedisQueuedLocks
89
101
  ) -> void
90
102
 
91
103
  def find_opposite_request_ahead: (
92
- Symbol access_strategy,
104
+ RQL::accessStrategy access_strategy,
93
105
  [String, Float]? opposite_waiting_request,
94
106
  Integer|Float acquirer_position,
95
107
  String acquirer_id
@@ -104,7 +116,7 @@ module RedisQueuedLocks
104
116
 
105
117
  def lock_obstacle: (
106
118
  bool read_mode,
107
- Symbol access_strategy,
119
+ RQL::accessStrategy access_strategy,
108
120
  String acquirer_id,
109
121
  String? waiting_acquirer,
110
122
  String? opposite_request_ahead,
@@ -122,20 +134,55 @@ module RedisQueuedLocks
122
134
  Integer queue_ttl,
123
135
  String acquirer_id,
124
136
  String host_id,
125
- Symbol access_strategy,
126
- Symbol read_write_mode,
137
+ RQL::accessStrategy access_strategy,
138
+ RQL::readWriteMode read_write_mode,
127
139
  String? waiting_acquirer,
128
- String? opposite_request_ahead,
140
+ Integer? waiting_priority,
141
+ [String, Float]? opposite_waiting_request,
129
142
  String? current_lock_obtainer
130
143
  ) -> void
131
144
 
145
+ def logged_request_priority: (
146
+ bool log_sampled,
147
+ bool log_lock_try,
148
+ [String, Float]? lock_request
149
+ ) -> Integer?
150
+
151
+ def drop_dead_requests_ahead: (
152
+ RC::client rconn,
153
+ RQL::readWriteMode read_write_mode,
154
+ String request_queue,
155
+ String opposite_request_queue,
156
+ String acquirer_id,
157
+ Integer|Float acquirer_position,
158
+ Float acquirer_dead_score,
159
+ RQL::accessStrategy access_strategy,
160
+ [String, Float]? waiting_request,
161
+ [String, Float]? opposite_waiting_request
162
+ ) -> [[String, Float]?, [String, Float]?, Array[[String, Integer]]]?
163
+
164
+ def log_dropped_requests: (
165
+ RQL::loggerObj logger,
166
+ bool log_sampled,
167
+ bool log_lock_try,
168
+ String lock_key,
169
+ Integer queue_ttl,
170
+ String acquirer_id,
171
+ String host_id,
172
+ RQL::accessStrategy access_strategy,
173
+ RQL::readWriteMode read_write_mode,
174
+ Array[[String, Integer]] dropped_requests
175
+ ) -> void
176
+
177
+ def dead_request_priority: ([String, Float] lock_request, Float acquirer_dead_score) -> Integer?
178
+
132
179
  def precheck_lock: (
133
180
  RC::client rconn,
134
181
  RQL::loggerObj logger,
135
182
  bool log_sampled,
136
183
  bool log_lock_try,
137
184
  String lock_key,
138
- Symbol read_write_mode,
185
+ RQL::readWriteMode read_write_mode,
139
186
  String lock_readers_key,
140
187
  String request_queue,
141
188
  String opposite_request_queue,
@@ -143,12 +190,13 @@ module RedisQueuedLocks
143
190
  String acquirer_id,
144
191
  String host_id,
145
192
  Integer|Float acquirer_position,
193
+ Integer priority,
146
194
  Float acquirer_dead_score,
147
195
  Integer queue_ttl,
148
196
  bool lock_index_enabled,
149
197
  Integer lock_index_grace_period,
150
198
  bool fail_fast,
151
- Symbol access_strategy
199
+ RQL::accessStrategy access_strategy
152
200
  ) -> (lockObstacle | :fail_fast_no_try)?
153
201
  end
154
202
  end
@@ -12,8 +12,8 @@ module RedisQueuedLocks
12
12
  Integer queue_ttl,
13
13
  String acquirer_id,
14
14
  String host_id,
15
- Symbol access_strategy,
16
- Symbol rw_mode
15
+ RQL::accessStrategy access_strategy,
16
+ RQL::readWriteMode rw_mode
17
17
  ) -> void
18
18
 
19
19
  def self.decrease_lock: (
@@ -24,8 +24,8 @@ module RedisQueuedLocks
24
24
  Integer queue_ttl,
25
25
  String acquirer_id,
26
26
  String host_id,
27
- Symbol access_strategy,
28
- Symbol rw_mode
27
+ RQL::accessStrategy access_strategy,
28
+ RQL::readWriteMode rw_mode
29
29
  ) -> void
30
30
  end
31
31
  end
@@ -13,10 +13,10 @@ module RedisQueuedLocks
13
13
  String lock_key,
14
14
  String lock_readers_key,
15
15
  String? read_lock_key,
16
- Symbol rw_mode,
16
+ RQL::readWriteMode rw_mode,
17
17
  String acquirer_id,
18
18
  String host_id,
19
- Symbol access_strategy,
19
+ RQL::accessStrategy access_strategy,
20
20
  bool timed,
21
21
  Integer|Float ttl_shift,
22
22
  Integer ttl,
@@ -37,9 +37,11 @@ module RedisQueuedLocks
37
37
  logger: RQL::loggerObj,
38
38
  log_lock_try: bool,
39
39
  instrument: untyped?,
40
- conflict_strategy: Symbol,
41
- read_write_mode: Symbol,
42
- access_strategy: Symbol,
40
+ conflict_strategy: RQL::conflictStrategy,
41
+ read_write_mode: Symbol, # NOTE: (rbs test) validated at runtime (Step 0.1 (RW)): any Symbol is accepted here
42
+ access_strategy: RQL::accessStrategy,
43
+ priority: RQL::lockPriority,
44
+ lock_priorities: Hash[Symbol, Integer],
43
45
  log_sampling_enabled: bool,
44
46
  log_sampling_percent: Integer,
45
47
  log_sampler: RQL::Logging::samplerObj,