redis_queued_locks 1.20.0 → 1.21.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/project-overview.md +35 -13
  3. data/.claude/rules/acquirer.md +10 -9
  4. data/.claude/rules/logic.md +28 -5
  5. data/.claude/rules/swarm.md +2 -2
  6. data/.claude/rules/tests.md +6 -3
  7. data/.claude/rules/visitors.md +9 -10
  8. data/.claude/skills/rql-code-review/SKILL.md +24 -10
  9. data/CHANGELOG.md +126 -0
  10. data/CLAUDE.md +2 -1
  11. data/README.md +245 -70
  12. data/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +1 -0
  13. data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +42 -0
  14. data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +45 -0
  15. data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +1 -0
  16. data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb +12 -1
  17. data/lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb +2 -2
  18. data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb +1 -0
  19. data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb +5 -5
  20. data/lib/redis_queued_locks/acquirer/acquire_lock.rb +111 -24
  21. data/lib/redis_queued_locks/acquirer/clear_dead_requests.rb +86 -8
  22. data/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb +122 -12
  23. data/lib/redis_queued_locks/acquirer/is_locked.rb +0 -1
  24. data/lib/redis_queued_locks/acquirer/is_queued.rb +0 -1
  25. data/lib/redis_queued_locks/acquirer/keys.rb +10 -1
  26. data/lib/redis_queued_locks/acquirer/lock_info.rb +31 -39
  27. data/lib/redis_queued_locks/acquirer/lock_series_poc/instr_visitor.rb +3 -2
  28. data/lib/redis_queued_locks/acquirer/lock_series_poc/log_visitor.rb +5 -4
  29. data/lib/redis_queued_locks/acquirer/lock_series_poc.rb +55 -15
  30. data/lib/redis_queued_locks/acquirer/locks.rb +26 -9
  31. data/lib/redis_queued_locks/acquirer/queue_info.rb +0 -1
  32. data/lib/redis_queued_locks/acquirer/queues.rb +10 -1
  33. data/lib/redis_queued_locks/acquirer/reindex_locks.rb +117 -4
  34. data/lib/redis_queued_locks/acquirer/release_all_locks.rb +31 -4
  35. data/lib/redis_queued_locks/acquirer/release_lock.rb +33 -7
  36. data/lib/redis_queued_locks/acquirer/release_locks_of.rb +39 -4
  37. data/lib/redis_queued_locks/acquirer/release_read_lock.rb +22 -3
  38. data/lib/redis_queued_locks/client.rb +82 -40
  39. data/lib/redis_queued_locks/config.rb +12 -13
  40. data/lib/redis_queued_locks/errors.rb +34 -4
  41. data/lib/redis_queued_locks/instrument/sampler.rb +4 -7
  42. data/lib/redis_queued_locks/logging/sampler.rb +4 -8
  43. data/lib/redis_queued_locks/resource.rb +14 -4
  44. data/lib/redis_queued_locks/swarm/flush_zombies.rb +1 -0
  45. data/lib/redis_queued_locks/swarm/redis_client_builder.rb +8 -4
  46. data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +3 -2
  47. data/lib/redis_queued_locks/swarm.rb +86 -5
  48. data/lib/redis_queued_locks/utilities.rb +1 -1
  49. data/lib/redis_queued_locks/version.rb +2 -2
  50. data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +14 -0
  51. data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +13 -0
  52. data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +2 -2
  53. data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +1 -1
  54. data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +9 -0
  55. data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +15 -2
  56. data/sig/redis_queued_locks/acquirer/reindex_locks.rbs +22 -1
  57. data/sig/redis_queued_locks/acquirer/release_lock.rbs +3 -2
  58. data/sig/redis_queued_locks/acquirer/release_read_lock.rbs +1 -1
  59. data/sig/redis_queued_locks/client.rbs +14 -3
  60. data/sig/redis_queued_locks/errors.rbs +5 -2
  61. data/sig/redis_queued_locks/instrument/sampler.rbs +0 -2
  62. data/sig/redis_queued_locks/logging/sampler.rbs +0 -2
  63. data/sig/redis_queued_locks/resource.rbs +1 -1
  64. data/sig/vendor/redis_client.rbs +1 -0
  65. metadata +1 -1
@@ -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.20.0
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.20.0
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 ppublic
189
+ # @api public
146
190
  # @since 1.9.0
147
- # @version 1.20.0
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.20.0
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,
@@ -39,7 +39,7 @@ module RedisQueuedLocks::Utilities
39
39
  # @return [Boolean]
40
40
  #
41
41
  # @api public
42
- # @since ?.?.?
42
+ # @since 1.16.0
43
43
  RUBY_OVER_4 = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0')
44
44
 
45
45
  # @yield
@@ -5,6 +5,6 @@ module RedisQueuedLocks
5
5
  #
6
6
  # @api public
7
7
  # @since 0.0.1
8
- # @version 1.20.0
9
- VERSION = '1.20.0'
8
+ # @version 1.21.0
9
+ VERSION = '1.21.0'
10
10
  end
@@ -70,6 +70,20 @@ module RedisQueuedLocks
70
70
  Integer|Float hold_time,
71
71
  untyped? instrument
72
72
  ) -> void
73
+
74
+ def self.lock_obtaining_failed: (
75
+ RQL::instrObj instrumenter,
76
+ bool instr_sampled,
77
+ String lock_key,
78
+ Symbol rw_mode,
79
+ Integer ttl,
80
+ String acq_id,
81
+ String hst_id,
82
+ Integer|Float ts,
83
+ Integer|Float acq_time,
84
+ Symbol result,
85
+ untyped? instrument
86
+ ) -> void
73
87
  end
74
88
  end
75
89
  end
@@ -72,6 +72,19 @@ module RedisQueuedLocks
72
72
  Symbol access_strategy,
73
73
  Symbol rw_mode
74
74
  ) -> void
75
+
76
+ def self.lock_obtaining_failed: (
77
+ RQL::loggerObj logger,
78
+ bool log_sampled,
79
+ String lock_key,
80
+ Integer queue_ttl,
81
+ String acquirer_id,
82
+ String host_id,
83
+ Integer|Float acq_time,
84
+ Symbol access_strategy,
85
+ Symbol rw_mode,
86
+ Symbol result
87
+ ) -> void
75
88
  end
76
89
  end
77
90
  end
@@ -19,7 +19,7 @@ module RedisQueuedLocks
19
19
  Symbol access_strategy,
20
20
  bool timed,
21
21
  Integer|Float ttl_shift,
22
- Integer? ttl,
22
+ Integer ttl,
23
23
  Integer queue_ttl,
24
24
  Hash[String|Symbol,untyped]? meta,
25
25
  bool log_sampled,
@@ -33,7 +33,7 @@ module RedisQueuedLocks
33
33
  def yield_with_timeout: (
34
34
  Float timeout,
35
35
  String lock_key,
36
- Integer? lock_ttl,
36
+ Integer lock_ttl,
37
37
  String acquirer_id,
38
38
  String host_id,
39
39
  Hash[String|Symbol,untyped]? meta,
@@ -19,7 +19,7 @@ module RedisQueuedLocks
19
19
  thread_id: Integer|String,
20
20
  fiber_id: Integer|String,
21
21
  ractor_id: Integer|String,
22
- ttl: Integer?,
22
+ ttl: Integer,
23
23
  queue_ttl: Integer,
24
24
  lock_index_enabled: bool,
25
25
  lock_index_grace_period: Integer,
@@ -4,6 +4,8 @@ use RedisClient as RC
4
4
  module RedisQueuedLocks
5
5
  module Acquirer
6
6
  module ClearDeadRequests
7
+ extend RQL::Utilities
8
+
7
9
  type clearResult = { ok: bool, result: { processed_queues: Set[String] } }
8
10
  def self.clear_dead_requests: (
9
11
  RC::client redis_client,
@@ -23,6 +25,13 @@ module RedisQueuedLocks
23
25
  bool instr_sample_this
24
26
  ) -> clearResult
25
27
 
28
+ private def self.fully_clear_dead_requests: (
29
+ RC::client redis_client,
30
+ Integer scan_size,
31
+ Integer dead_ttl,
32
+ bool lock_index_enabled
33
+ ) -> Set[String]
34
+
26
35
  private def self.each_lock_queue: (RC::client redis_client, Integer scan_size) { (String lock_queue) -> void } -> void
27
36
  private def self.drop_dead_requests: (RC::client redis_client, Array[String] lock_queues, Float dead_score) -> void
28
37
  private def self.drop_dead_requests_of_locks: (
@@ -4,6 +4,8 @@ use RedisClient as RC
4
4
  module RedisQueuedLocks
5
5
  module Acquirer
6
6
  module ExtendLockTTL
7
+ extend RQL::Utilities
8
+
7
9
  EXTEND_LOCK_PTTL: String
8
10
 
9
11
  type extendResult = { ok: bool, result: { extended_locks_count: Integer } | Symbol }
@@ -18,16 +20,27 @@ module RedisQueuedLocks
18
20
  RQL::loggerObj logger,
19
21
  RQL::instrObj instrumenter,
20
22
  untyped? instrument,
21
- bool log_samling_enabled,
23
+ bool log_sampling_enabled,
22
24
  Integer log_sampling_percent,
23
25
  RQL::Logging::samplerObj log_sampler,
24
- bool sample_this,
26
+ bool log_sample_this,
25
27
  bool instr_sampling_enabled,
26
28
  Integer instr_sampling_percent,
27
29
  RQL::Instrument::samplerObj instr_sampler,
28
30
  bool instr_sample_this
29
31
  ) -> extendResult
30
32
 
33
+ private def self.fully_extend_lock_ttl: (
34
+ RC::client redis_client,
35
+ String lock_name,
36
+ String lock_key,
37
+ Integer milliseconds,
38
+ Symbol read_write_mode,
39
+ bool all_read_locks,
40
+ String acquirer_id,
41
+ bool lock_index_enabled
42
+ ) -> extendResult
43
+
31
44
  private def self.extend_read_lock_ttl: (
32
45
  RC::client redis_client,
33
46
  String lock_name,
@@ -1,16 +1,37 @@
1
+ use RedisQueuedLocks as RQL
1
2
  use RedisClient as RC
2
3
 
3
4
  module RedisQueuedLocks
4
5
  module Acquirer
5
6
  module ReindexLocks
7
+ extend RQL::Utilities
8
+
6
9
  type reindexResult = { ok: bool, result: { idx_key_cnt: Integer } }
7
10
  def self.reindex_locks: (
8
11
  RC::client redis_client,
9
12
  Integer scan_size,
10
13
  Integer queue_ttl,
11
- Integer lock_index_grace_period
14
+ Integer lock_index_grace_period,
15
+ RQL::loggerObj logger,
16
+ RQL::instrObj instrumenter,
17
+ untyped? instrument,
18
+ bool log_sampling_enabled,
19
+ Integer log_sampling_percent,
20
+ RQL::Logging::samplerObj log_sampler,
21
+ bool log_sample_this,
22
+ bool instr_sampling_enabled,
23
+ Integer instr_sampling_percent,
24
+ RQL::Instrument::samplerObj instr_sampler,
25
+ bool instr_sample_this
12
26
  ) -> reindexResult
13
27
 
28
+ private def self.fully_reindex_locks: (
29
+ RC::client redis_client,
30
+ Integer scan_size,
31
+ Integer queue_ttl,
32
+ Integer lock_index_grace_period
33
+ ) -> Integer
34
+
14
35
  private def self.index_lock_keys: (
15
36
  RC::client redis_client,
16
37
  Array[String] lock_keys,
@@ -20,10 +20,11 @@ module RedisQueuedLocks
20
20
  RC::client redis,
21
21
  String lock_name,
22
22
  bool lock_index_enabled,
23
- RQL::instrObj instrumenter,
24
23
  RQL::loggerObj logger,
24
+ RQL::instrObj instrumenter,
25
+ untyped? instrument,
25
26
  bool log_sampling_enabled,
26
- Integer log_samplingPercent,
27
+ Integer log_sampling_percent,
27
28
  RQL::Logging::samplerObj log_sampler,
28
29
  bool log_sample_this,
29
30
  bool instr_sampling_enabled,
@@ -19,8 +19,8 @@ module RedisQueuedLocks
19
19
  RC::client redis,
20
20
  String lock_name,
21
21
  String acquirer_id,
22
- RQL::instrObj instrumenter,
23
22
  RQL::loggerObj logger,
23
+ RQL::instrObj instrumenter,
24
24
  untyped? instrument,
25
25
  bool log_sampling_enabled,
26
26
  Integer log_sampling_percent,
@@ -141,7 +141,7 @@ module RedisQueuedLocks
141
141
  ?ractor_id: Integer|String,
142
142
  ?identity: String
143
143
  ) -> String
144
- alias ccurrent_acq_id current_acquirer_id
144
+ alias current_acq_id current_acquirer_id
145
145
  alias acq_id current_acquirer_id
146
146
 
147
147
  def current_host_id: (
@@ -236,7 +236,7 @@ module RedisQueuedLocks
236
236
  | (?scan_size: Integer, ?with_info: true) -> RQL::Acquirer::Queues::queuesInfo
237
237
  | (?scan_size: Integer, ?with_info: false) -> RQL::Acquirer::Queues::queueList
238
238
 
239
- def queues_info: (?scan_size: Integer) -> RQL::Acquirer::Queues::queues
239
+ def queues_info: (?scan_size: Integer) -> RQL::Acquirer::Queues::queuesInfo
240
240
  def keys: (?scan_size: Integer) -> RQL::Acquirer::Keys::keyList
241
241
 
242
242
  def clear_dead_requests: (
@@ -258,7 +258,18 @@ module RedisQueuedLocks
258
258
  def reindex_locks: (
259
259
  ?scan_size: Integer,
260
260
  ?queue_ttl: Integer,
261
- ?lock_index_grace_period: Integer
261
+ ?lock_index_grace_period: Integer,
262
+ ?logger: RQL::loggerObj,
263
+ ?instrumenter: RQL::instrObj,
264
+ ?instrument: untyped?,
265
+ ?log_sampling_enabled: bool,
266
+ ?log_sampling_percent: Integer,
267
+ ?log_sampler: RQL::Logging::samplerObj,
268
+ ?log_sample_this: bool,
269
+ ?instr_sampling_enabled: bool,
270
+ ?instr_sampling_percent: Integer,
271
+ ?instr_sampler: RQL::Instrument::samplerObj,
272
+ ?instr_sample_this: bool
262
273
  ) -> RQL::Acquirer::ReindexLocks::reindexResult
263
274
  end
264
275
  end
@@ -5,10 +5,13 @@ module RedisQueuedLocks
5
5
  class ArgumentError < ::ArgumentError
6
6
  end
7
7
 
8
+ class Exception < ::Exception
9
+ end
10
+
8
11
  class LockAlreadyObtainedError < Error
9
12
  end
10
13
 
11
- class LockAcquirementIntermediateTimeoutError < ::Timeout::Error
14
+ class LockAcquirementIntermediateTimeoutError < Exception
12
15
  end
13
16
 
14
17
  class LockAcquirementTimeoutError < Error
@@ -17,7 +20,7 @@ module RedisQueuedLocks
17
20
  class LockAcquirementRetryLimitError < Error
18
21
  end
19
22
 
20
- class TimedLockIntermediateTimeoutError < ::Timeout::Error
23
+ class TimedLockIntermediateTimeoutError < Exception
21
24
  end
22
25
 
23
26
  class TimedLockTimeoutError < Error
@@ -1,8 +1,6 @@
1
1
  module RedisQueuedLocks
2
2
  module Instrument
3
3
  module Sampler
4
- SAMPLING_PERCENT_RANGE: Range[Integer]
5
-
6
4
  def self.sampling_happened?: (Integer sampling_percent) -> bool
7
5
  end
8
6
  end
@@ -1,8 +1,6 @@
1
1
  module RedisQueuedLocks
2
2
  module Logging
3
3
  module Sampler
4
- SAMPLING_PERCENT_RANGE: Range[Integer]
5
-
6
4
  def self.sampling_happened?: (Integer sampling_percent) -> bool
7
5
  end
8
6
  end
@@ -45,7 +45,7 @@ module RedisQueuedLocks
45
45
  def self.acquirer_dead_score: (Integer|Float queue_ttl) -> Float
46
46
  def self.calc_zombie_score: (Float zombie_ttl) -> Float
47
47
  def self.dead_score_reached?: (Float acquirer_position, Integer queue_ttl) -> bool
48
- def self.lock_key_from_queue: (String lock_queue) -> String
48
+ def self.lock_key_from_queue: (String lock_queue) -> String?
49
49
  def self.get_thread_id: () -> Integer
50
50
  def self.get_fiber_id: () -> Integer
51
51
  def self.get_ractor_id: () -> Integer
@@ -6,6 +6,7 @@ class RedisClient
6
6
  def zscan: (String key, *untyped) { (String member, String score) -> untyped } -> untyped
7
7
  def multi: (?watch: Array[String]) { (Multi transact) -> untyped } -> untyped
8
8
  def with: (?untyped) { (::RedisClient|::RedisClient::Pooled rconn) -> untyped } -> untyped
9
+ def close: () -> void
9
10
  end
10
11
 
11
12
  include _Client
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_queued_locks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov