redis_queued_locks 1.12.1 → 1.14.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 (122) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -1
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +45 -5
  5. data/LICENSE.txt +1 -1
  6. data/README.md +574 -296
  7. data/Rakefile +12 -4
  8. data/Steepfile +15 -0
  9. data/github_ci/ruby3.3.gemfile +17 -0
  10. data/github_ci/ruby3.3.gemfile.lock +217 -0
  11. data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/delay_execution.rb +4 -4
  12. data/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +40 -0
  13. data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/dequeue_from_lock_queue.rb +17 -8
  14. data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +166 -0
  15. data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +218 -0
  16. data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +543 -0
  17. data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/try_to_lock.rb +126 -92
  18. data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/with_acq_timeout.rb +14 -9
  19. data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb +76 -0
  20. data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/yield_expire.rb +42 -19
  21. data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock.rb +74 -47
  22. data/lib/redis_queued_locks/{acquier → acquirer}/clear_dead_requests.rb +5 -3
  23. data/lib/redis_queued_locks/{acquier → acquirer}/extend_lock_ttl.rb +4 -3
  24. data/lib/redis_queued_locks/{acquier → acquirer}/is_locked.rb +1 -1
  25. data/lib/redis_queued_locks/{acquier → acquirer}/is_queued.rb +1 -1
  26. data/lib/redis_queued_locks/{acquier → acquirer}/keys.rb +5 -5
  27. data/lib/redis_queued_locks/{acquier → acquirer}/lock_info.rb +9 -5
  28. data/lib/redis_queued_locks/{acquier → acquirer}/locks.rb +16 -3
  29. data/lib/redis_queued_locks/{acquier → acquirer}/queue_info.rb +8 -6
  30. data/lib/redis_queued_locks/{acquier → acquirer}/queues.rb +9 -2
  31. data/lib/redis_queued_locks/{acquier → acquirer}/release_all_locks.rb +26 -21
  32. data/lib/redis_queued_locks/{acquier → acquirer}/release_lock.rb +28 -22
  33. data/lib/redis_queued_locks/acquirer/release_locks_of.rb +211 -0
  34. data/lib/redis_queued_locks/acquirer.rb +19 -0
  35. data/lib/redis_queued_locks/client.rb +317 -254
  36. data/lib/redis_queued_locks/config/dsl.rb +94 -0
  37. data/lib/redis_queued_locks/config.rb +236 -0
  38. data/lib/redis_queued_locks/data.rb +2 -0
  39. data/lib/redis_queued_locks/errors.rb +27 -11
  40. data/lib/redis_queued_locks/instrument.rb +11 -4
  41. data/lib/redis_queued_locks/logging/void_logger.rb +38 -1
  42. data/lib/redis_queued_locks/logging.rb +20 -5
  43. data/lib/redis_queued_locks/resource.rb +49 -11
  44. data/lib/redis_queued_locks/swarm/acquirers.rb +17 -16
  45. data/lib/redis_queued_locks/swarm/flush_zombies.rb +26 -25
  46. data/lib/redis_queued_locks/swarm/probe_hosts.rb +20 -19
  47. data/lib/redis_queued_locks/swarm/redis_client_builder.rb +3 -3
  48. data/lib/redis_queued_locks/swarm/supervisor.rb +19 -6
  49. data/lib/redis_queued_locks/swarm/swarm_element/isolated.rb +20 -18
  50. data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +35 -27
  51. data/lib/redis_queued_locks/swarm/zombie_info.rb +9 -9
  52. data/lib/redis_queued_locks/swarm.rb +20 -41
  53. data/lib/redis_queued_locks/utilities.rb +11 -2
  54. data/lib/redis_queued_locks/version.rb +2 -2
  55. data/lib/redis_queued_locks.rb +2 -3
  56. data/rbs_collection.lock.yaml +28 -0
  57. data/rbs_collection.yaml +17 -0
  58. data/redis_queued_locks.gemspec +22 -23
  59. data/sig/manifest.yml +6 -0
  60. data/sig/redis_queued_locks/acquier.rbs +4 -0
  61. data/sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs +9 -0
  62. data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs +21 -0
  63. data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs +26 -0
  64. data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +71 -0
  65. data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +72 -0
  66. data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs +179 -0
  67. data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs +48 -0
  68. data/sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs +19 -0
  69. data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +41 -0
  70. data/sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs +32 -0
  71. data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +52 -0
  72. data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +28 -0
  73. data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +28 -0
  74. data/sig/redis_queued_locks/acquirer/is_locked.rbs +9 -0
  75. data/sig/redis_queued_locks/acquirer/is_queued.rbs +9 -0
  76. data/sig/redis_queued_locks/acquirer/keys.rbs +10 -0
  77. data/sig/redis_queued_locks/acquirer/lock_info.rbs +10 -0
  78. data/sig/redis_queued_locks/acquirer/locks.rbs +16 -0
  79. data/sig/redis_queued_locks/acquirer/queue_info.rbs +13 -0
  80. data/sig/redis_queued_locks/acquirer/queues.rbs +16 -0
  81. data/sig/redis_queued_locks/acquirer/release_all_locks.rbs +30 -0
  82. data/sig/redis_queued_locks/acquirer/release_lock.rbs +38 -0
  83. data/sig/redis_queued_locks/acquirer/release_locks_of.rbs +46 -0
  84. data/sig/redis_queued_locks/client.rbs +235 -0
  85. data/sig/redis_queued_locks/config/dsl.rbs +26 -0
  86. data/sig/redis_queued_locks/config.rbs +23 -0
  87. data/sig/redis_queued_locks/data.rbs +4 -0
  88. data/sig/redis_queued_locks/debugger/interface.rbs +9 -0
  89. data/sig/redis_queued_locks/debugger.rbs +13 -0
  90. data/sig/redis_queued_locks/errors.rbs +43 -0
  91. data/sig/redis_queued_locks/instrument/active_support.rbs +7 -0
  92. data/sig/redis_queued_locks/instrument/sampler.rbs +9 -0
  93. data/sig/redis_queued_locks/instrument/void_notifier.rbs +7 -0
  94. data/sig/redis_queued_locks/instrument.rbs +15 -0
  95. data/sig/redis_queued_locks/logging/sampler.rbs +9 -0
  96. data/sig/redis_queued_locks/logging/void_logger.rbs +15 -0
  97. data/sig/redis_queued_locks/logging.rbs +15 -0
  98. data/sig/redis_queued_locks/resource.rbs +42 -0
  99. data/sig/redis_queued_locks/swarm/acquirers.rbs +10 -0
  100. data/sig/redis_queued_locks/swarm/flush_zombies.rbs +13 -0
  101. data/sig/redis_queued_locks/swarm/probe_hosts.rbs +13 -0
  102. data/sig/redis_queued_locks/swarm/redis_client_builder.rbs +19 -0
  103. data/sig/redis_queued_locks/swarm/supervisor.rbs +26 -0
  104. data/sig/redis_queued_locks/swarm/swarm_element/isolated.rbs +52 -0
  105. data/sig/redis_queued_locks/swarm/swarm_element/threaded.rbs +61 -0
  106. data/sig/redis_queued_locks/swarm/swarm_element.rbs +8 -0
  107. data/sig/redis_queued_locks/swarm/zombie_info.rbs +24 -0
  108. data/sig/redis_queued_locks/swarm.rbs +41 -0
  109. data/sig/redis_queued_locks/utilities/lock.rbs +10 -0
  110. data/sig/redis_queued_locks/utilities.rbs +12 -0
  111. data/sig/redis_queued_locks/version.rbs +3 -0
  112. data/sig/redis_queued_locks.rbs +14 -0
  113. data/sig/vendor/active_support.rbs +9 -0
  114. data/sig/vendor/redis_client.rbs +39 -0
  115. data/sig/vendor/semantic_logger.rbs +4 -0
  116. metadata +98 -54
  117. data/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +0 -40
  118. data/lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb +0 -166
  119. data/lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb +0 -216
  120. data/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb +0 -541
  121. data/lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb +0 -76
  122. data/lib/redis_queued_locks/acquier.rb +0 -18
@@ -0,0 +1,26 @@
1
+ use RedisQueuedLocks as RQL
2
+
3
+ module RedisQueuedLocks
4
+ class Swarm
5
+ class Supervisor
6
+ include RQL::Utilities
7
+
8
+ @rql_client: RQL::Client
9
+ @visor: Thread?
10
+ @observable: Proc?
11
+
12
+ attr_reader rql_client: RQL::Client
13
+ attr_reader visor: Thread?
14
+ attr_reader observable: Proc?
15
+
16
+ def initialize: (RQL::Client rql_client) -> void
17
+
18
+ type supervisorStatus = { running: bool, state: String, observable: String }
19
+ def status: () -> supervisorStatus
20
+
21
+ def observe!: () { (?) -> untyped } -> void
22
+ def running?: () -> bool
23
+ def stop!: () -> void
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,52 @@
1
+ use RedisQueuedLocks as RQL
2
+
3
+ module RedisQueuedLocks
4
+ class Swarm
5
+ module SwarmElement
6
+ class Isolated
7
+ include RQL::Utilities
8
+
9
+ @rql_client: RQL::Client
10
+ @swarm_element: Ractor?
11
+ @sync: RQL::Utilities::Lock
12
+
13
+ attr_reader rql_client: RQL::Client
14
+ attr_reader swarm_element: Ractor?
15
+ attr_reader sync: RQL::Utilities::Lock
16
+
17
+ def initialize: (RQL::Client rql_client) -> void
18
+ def try_swarm!: () -> void
19
+ def reswarm_if_dead!: () -> void
20
+ def try_kill!: () -> void
21
+ def enabled?: () -> bool
22
+
23
+ type elementStatus = {
24
+ enabled: bool,
25
+ ractor: { running: bool, state: String },
26
+ main_loop: { running: bool, state: String }
27
+ }
28
+ def status: () -> elementStatus
29
+
30
+ def self.swarm_loop: () { () -> Thread } -> void
31
+
32
+ private
33
+
34
+ def swarm!: () -> void
35
+ def idle?: () -> bool
36
+ def swarmed?: () -> bool
37
+ def swarmed__alive?: () -> bool
38
+ def swarmed__dead?: () -> bool
39
+ def swarmed__running?: () -> bool
40
+ def swarmed__stopped?: () -> bool
41
+ def swarm_loop__is_active: () -> bool
42
+
43
+ type swarmLoopStatus = { main_loop: { alive: bool, state: String } }
44
+ def swarm_loop__status: () -> swarmLoopStatus?
45
+
46
+ def swarm_loop__start: () -> void
47
+ def swarm_loop__pause: () -> void
48
+ def swarm_loop__kill: () -> void
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,61 @@
1
+ use RedisQueuedLocks as RQL
2
+
3
+ module RedisQueuedLocks
4
+ class Swarm
5
+ module SwarmElement
6
+ class Threaded
7
+ include RQL::Utilities
8
+
9
+ @rql_client: RQL::Client
10
+ @swarm_element: Thread?
11
+ @main_loop: Thread?
12
+ @swarm_element_commands: Thread::SizedQueue[Symbol]?
13
+ @swarm_element_results: Thread::SizedQueue[{ ok: bool, result: Hash[untyped,untyped] }]?
14
+ @sync: RQL::Utilities::Lock
15
+
16
+ attr_reader rql_client: RQL::Client
17
+ attr_reader swarm_element: Thread?
18
+ attr_reader main_loop: Thread?
19
+ attr_reader swarm_element_commands: Thread::SizedQueue[Symbol]?
20
+ attr_reader swarm_element_results: Thread::SizedQueue[{ ok: bool, result: Hash[untyped,untyped] }]?
21
+ attr_reader sync: RQL::Utilities::Lock
22
+
23
+ def initialize: (RQL::Client rql_client) -> void
24
+
25
+ def try_swarm!: () -> void
26
+ def reswarm_if_dead!: () -> void
27
+ def try_kill!: () -> void
28
+ def enabled?: () -> bool
29
+
30
+ type elementStatus = {
31
+ enabled: bool,
32
+ thread: { running: bool, state: String },
33
+ main_loop: { running: bool, state: String }
34
+ }
35
+ def status: () -> elementStatus
36
+
37
+ private
38
+
39
+ def swarm!: () -> void
40
+ def spawn_main_loop!: () -> Thread
41
+ def idle?: () -> bool
42
+ def swarmed?: () -> bool
43
+ def swarmed__alive?: () -> bool
44
+ def swarmed__dead?: () -> bool
45
+ def swarmed__running?: () -> bool
46
+ def terminating?: () -> bool?
47
+ def swarmed__stopped?: () -> bool
48
+
49
+ type swarmLoopIsActive = { ok: bool, result: { is_active: bool } }
50
+ def swarm_loop__is_active: () -> swarmLoopIsActive?
51
+
52
+ type swarmLoopStatus = { ok: bool, result: { main_loop: { alive: bool, state: String } } }
53
+ def swarm_loop__status: () -> swarmLoopStatus?
54
+
55
+ def swarm_loop__start: () -> void
56
+ def swarm_loop__stop: () -> void
57
+ def swarm_element__termiante: () -> void
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RedisQueuedLocks
4
+ class Swarm
5
+ module SwarmElement
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ use RedisClient as RC
2
+
3
+ module RedisQueuedLocks
4
+ class Swarm
5
+ module ZombieInfo
6
+ type zombieInfo = { zombie_hosts: Set[String], zombie_acquirers: Set[String], zombie_locks: Set[String] }
7
+ def self.zombies_info: (RC::client redis_client, Integer zombie_ttl, Integer lock_scan_size) -> zombieInfo
8
+
9
+ type zombieLocks = Set[String]
10
+ def self.zombie_locks: (RC::client redis_client, Integer zombie_ttl, Integer lock_scan_size) -> zombieLocks
11
+
12
+ type zombieHosts = Set[String]
13
+ def self.zombie_hosts: (RC::client redis_client, Integer zombie_ttl) -> zombieHosts
14
+
15
+ type zombieAcquirers = Set[String]
16
+ def self.zombie_acquirers: (RC::client redis_client, Integer zombie_ttl, Integer lock_scan_size) -> zombieAcquirers
17
+
18
+ private def self.extract_zombie_hosts: (RC::client rconn, Integer zombie_ttl) -> zombieHosts
19
+ private def self.extract_zombie_locks: (RC::client rconn, Integer zombie_ttl, Integer lock_scan_size) -> zombieLocks
20
+ private def self.extract_zombie_acquirers: (RC::client rconn, Integer zombie_ttl, Integer lock_scan_size) -> zombieAcquirers
21
+ private def self.extract_all: (RC::client rconn, Integer zombie_ttl, Integer lock_scan_size) -> zombieInfo
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,41 @@
1
+ use RedisQueuedLocks as RQL
2
+
3
+ module RedisQueuedLocks
4
+ class Swarm
5
+ @rql_client: RQL::Client
6
+ @supervisor: RQL::Swarm::Supervisor
7
+ @probe_hosts_element: RQL::Swarm::ProbeHosts
8
+ @flush_zombies_element: RQL::Swarm::FlushZombies
9
+ @sync: RQL::Utilities::Lock
10
+
11
+ attr_reader rql_client: RQL::Client
12
+ attr_reader supervisor: RQL::Swarm::Supervisor
13
+ attr_reader probe_hosts_element: RQL::Swarm::ProbeHosts
14
+ attr_reader flush_zombies_element: RQL::Swarm::FlushZombies
15
+ attr_reader sync: RQL::Utilities::Lock
16
+
17
+ def initialize: (RQL::Client rql_client) -> void
18
+
19
+ type swarmStatus = {
20
+ auto_swarm: bool,
21
+ supervisor: RQL::Swarm::Supervisor::supervisorStatus,
22
+ probe_hosts: RQL::Swarm::SwarmElement::Threaded::elementStatus,
23
+ flush_zombies: RQL::Swarm::SwarmElement::Isolated::elementStatus
24
+ }
25
+ def swarm_status: () -> swarmStatus
26
+
27
+ def swarm_info: (?zombie_ttl: Integer) -> RQL::Swarm::Acquirers::acquirersList
28
+ def probe_hosts: () -> RQL::Swarm::ProbeHosts::livingHosts
29
+ def flush_zombies: (?zombie_ttl: Integer, ?lock_scan_size: Integer, ?queue_scan_size: Integer) -> RQL::Swarm::FlushZombies::flushedZombies
30
+ def zombie_locks: (?zombie_ttl: Integer, ?lock_scan_size: Integer) -> RQL::Swarm::ZombieInfo::zombieLocks
31
+ def zombie_acquirers: (?zombie_ttl: Integer, ?lock_scan_size: Integer) -> RQL::Swarm::ZombieInfo::zombieAcquirers
32
+ def zombie_hosts: (?zombie_ttl: Integer) -> RQL::Swarm::ZombieInfo::zombieHosts
33
+ def zombies_info: (?zombie_ttl: Integer, ?lock_scan_size: Integer) -> RQL::Swarm::ZombieInfo::zombieInfo
34
+
35
+ type swarmizeResult = { ok: bool, result: Symbol }
36
+ def swarm!: () -> swarmizeResult
37
+
38
+ type deswarmizeResult = { ok: bool, result: Symbol }
39
+ def deswarm!: () -> deswarmizeResult
40
+ end
41
+ end
@@ -0,0 +1,10 @@
1
+ module RedisQueuedLocks
2
+ module Utilities
3
+ class Lock
4
+ @lock: Monitor
5
+
6
+ def initialize: () -> void
7
+ def synchronize: () { (?) -> untyped } -> untyped
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ module RedisQueuedLocks
2
+ module Utilities
3
+ RACTOR_LIVENESS_PATTERN: Regexp
4
+ RACTOR_STATUS_PATTERN: Regexp
5
+
6
+ def self?.run_non_critical: () { (?) -> untyped } -> untyped?
7
+ def self?.ractor_status: (Ractor ractor) -> String
8
+ def self?.ractor_alive?: (Ractor ractor) -> bool
9
+ def self?.thread_state: (Thread thread) -> String
10
+ def self?.clock_gettime: () -> Integer
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ module RedisQueuedLocks
2
+ VERSION: String
3
+ end
@@ -0,0 +1,14 @@
1
+ module RedisQueuedLocks
2
+ interface _Loggable
3
+ def debug: (?untyped? progname) { (?) -> untyped } -> untyped
4
+ end
5
+
6
+ interface _Instrumentable
7
+ def notify: (String event, ?Hash[untyped,untyped] payload) -> void
8
+ end
9
+
10
+ type loggerObj = Object & _Loggable
11
+ type instrObj = Object & _Instrumentable
12
+
13
+ extend ::RedisQueuedLocks::Debugger::Interface
14
+ end
@@ -0,0 +1,9 @@
1
+ module ActiveSupport
2
+ module Notifications
3
+ def self.instrument: (String event, Hash[untyped,untyped] payload) -> untyped
4
+ end
5
+
6
+ class BroadcastLogger
7
+ def debug: (*untyped, **untyped) { (?) -> untyped } -> untyped
8
+ end
9
+ end
@@ -0,0 +1,39 @@
1
+ class RedisClient
2
+ interface _Client
3
+ def call: (*untyped) -> untyped
4
+ def pipelined: () { (Pipeline pipeline) -> untyped } -> untyped
5
+ def scan: (*untyped) { (String key) -> untyped } -> untyped
6
+ def multi: (?watch: Array[String]) { (Multi transact) -> untyped } -> untyped
7
+ def with: (?untyped) { (::RedisClient|::RedisClient::Pooled rconn) -> untyped } -> untyped
8
+ end
9
+
10
+ include _Client
11
+
12
+ class Pooled
13
+ include _Client
14
+ end
15
+
16
+ class Pipeline
17
+ def call: (*untyped) -> untyped
18
+ end
19
+
20
+ class Multi
21
+ def call: (*untyped) -> untyped
22
+ end
23
+
24
+ class SentinelConfig
25
+ def new_pool: (**untyped) -> ::RedisClient::Pooled
26
+ def new_client: (**untyped) -> ::RedisClient
27
+ end
28
+
29
+ class Config
30
+ def new_pool: (**untyped) -> ::RedisClient::Pooled
31
+ def new_client: (**untyped) -> ::RedisClient
32
+ end
33
+
34
+ def self.sentinel: (**untyped) -> SentinelConfig
35
+ def self.config: (**untyped) -> Config
36
+
37
+ type client = ::RedisClient | ::RedisClient::Pooled
38
+ type config = ::RedisClient::Config | ::RedisClient::SentinelConfig
39
+ end
@@ -0,0 +1,4 @@
1
+ module SemanticLogger
2
+ class Logger
3
+ end
4
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_queued_locks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: redis-client
@@ -24,30 +23,12 @@ dependencies:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0.20'
27
- - !ruby/object:Gem::Dependency
28
- name: qonfig
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.28'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.28'
41
- description: '|> Distributed locks with "prioritized lock acquisition queue" capabilities
42
- based on the Redis Database. |> Each lock request is put into the request queue
43
- (each lock is hosted by it''s own queue separately from other queues) and processed
44
- in order of their priority (FIFO). |> Each lock request lives some period of time
45
- (RTTL) (with requeue capabilities) which guarantees the request queue will never
46
- be stacked. |> In addition to the classic `queued` (FIFO) strategy RQL supports
47
- `random` (RANDOM) lock obtaining strategy when any acquirer from the lock queue
48
- can obtain the lock regardless the position in the queue. |> Provides flexible invocation
49
- flow, parametrized limits (lock request ttl, lock ttl, queue ttl, lock attempts
50
- limit, fast failing, etc), logging and instrumentation.'
26
+ description: |-
27
+ |> Distributed locks with "prioritized lock acquisition queue" capabilities based on the Redis Database.
28
+ |> Each lock request is put into the request queue (each lock is hosted by it's own queue separately from other queues) and processed in order of their priority (FIFO).
29
+ |> Each lock request lives some period of time (RTTL) (with requeue capabilities) which guarantees the request queue will never be stacked.
30
+ |> In addition to the classic `queued` (FIFO) strategy RQL supports `random` (RANDOM) lock obtaining strategy when any acquirer from the lock queue can obtain the lock regardless the position in the queue.
31
+ |> Provides flexible invocation flow, parametrized limits (lock request ttl, lock ttl, queue ttl, lock attempts limit, fast failing, etc), logging and instrumentation.
51
32
  email:
52
33
  - iamdaiver@gmail.com
53
34
  executables: []
@@ -62,31 +43,37 @@ files:
62
43
  - LICENSE.txt
63
44
  - README.md
64
45
  - Rakefile
46
+ - Steepfile
47
+ - github_ci/ruby3.3.gemfile
48
+ - github_ci/ruby3.3.gemfile.lock
65
49
  - lib/redis_queued_locks.rb
66
- - lib/redis_queued_locks/acquier.rb
67
- - lib/redis_queued_locks/acquier/acquire_lock.rb
68
- - lib/redis_queued_locks/acquier/acquire_lock/delay_execution.rb
69
- - lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rb
70
- - lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb
71
- - lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb
72
- - lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb
73
- - lib/redis_queued_locks/acquier/acquire_lock/try_to_lock.rb
74
- - lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb
75
- - lib/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rb
76
- - lib/redis_queued_locks/acquier/acquire_lock/yield_expire.rb
77
- - lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb
78
- - lib/redis_queued_locks/acquier/clear_dead_requests.rb
79
- - lib/redis_queued_locks/acquier/extend_lock_ttl.rb
80
- - lib/redis_queued_locks/acquier/is_locked.rb
81
- - lib/redis_queued_locks/acquier/is_queued.rb
82
- - lib/redis_queued_locks/acquier/keys.rb
83
- - lib/redis_queued_locks/acquier/lock_info.rb
84
- - lib/redis_queued_locks/acquier/locks.rb
85
- - lib/redis_queued_locks/acquier/queue_info.rb
86
- - lib/redis_queued_locks/acquier/queues.rb
87
- - lib/redis_queued_locks/acquier/release_all_locks.rb
88
- - lib/redis_queued_locks/acquier/release_lock.rb
50
+ - lib/redis_queued_locks/acquirer.rb
51
+ - lib/redis_queued_locks/acquirer/acquire_lock.rb
52
+ - lib/redis_queued_locks/acquirer/acquire_lock/delay_execution.rb
53
+ - lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rb
54
+ - lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb
55
+ - lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb
56
+ - lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb
57
+ - lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb
58
+ - lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb
59
+ - lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb
60
+ - lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb
61
+ - lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb
62
+ - lib/redis_queued_locks/acquirer/clear_dead_requests.rb
63
+ - lib/redis_queued_locks/acquirer/extend_lock_ttl.rb
64
+ - lib/redis_queued_locks/acquirer/is_locked.rb
65
+ - lib/redis_queued_locks/acquirer/is_queued.rb
66
+ - lib/redis_queued_locks/acquirer/keys.rb
67
+ - lib/redis_queued_locks/acquirer/lock_info.rb
68
+ - lib/redis_queued_locks/acquirer/locks.rb
69
+ - lib/redis_queued_locks/acquirer/queue_info.rb
70
+ - lib/redis_queued_locks/acquirer/queues.rb
71
+ - lib/redis_queued_locks/acquirer/release_all_locks.rb
72
+ - lib/redis_queued_locks/acquirer/release_lock.rb
73
+ - lib/redis_queued_locks/acquirer/release_locks_of.rb
89
74
  - lib/redis_queued_locks/client.rb
75
+ - lib/redis_queued_locks/config.rb
76
+ - lib/redis_queued_locks/config/dsl.rb
90
77
  - lib/redis_queued_locks/data.rb
91
78
  - lib/redis_queued_locks/debugger.rb
92
79
  - lib/redis_queued_locks/debugger/interface.rb
@@ -112,7 +99,66 @@ files:
112
99
  - lib/redis_queued_locks/utilities.rb
113
100
  - lib/redis_queued_locks/utilities/lock.rb
114
101
  - lib/redis_queued_locks/version.rb
102
+ - rbs_collection.lock.yaml
103
+ - rbs_collection.yaml
115
104
  - redis_queued_locks.gemspec
105
+ - sig/manifest.yml
106
+ - sig/redis_queued_locks.rbs
107
+ - sig/redis_queued_locks/acquier.rbs
108
+ - sig/redis_queued_locks/acquirer/acquire_lock.rbs
109
+ - sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs
110
+ - sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs
111
+ - sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs
112
+ - sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs
113
+ - sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs
114
+ - sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs
115
+ - sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs
116
+ - sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs
117
+ - sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs
118
+ - sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs
119
+ - sig/redis_queued_locks/acquirer/clear_dead_requests.rbs
120
+ - sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs
121
+ - sig/redis_queued_locks/acquirer/is_locked.rbs
122
+ - sig/redis_queued_locks/acquirer/is_queued.rbs
123
+ - sig/redis_queued_locks/acquirer/keys.rbs
124
+ - sig/redis_queued_locks/acquirer/lock_info.rbs
125
+ - sig/redis_queued_locks/acquirer/locks.rbs
126
+ - sig/redis_queued_locks/acquirer/queue_info.rbs
127
+ - sig/redis_queued_locks/acquirer/queues.rbs
128
+ - sig/redis_queued_locks/acquirer/release_all_locks.rbs
129
+ - sig/redis_queued_locks/acquirer/release_lock.rbs
130
+ - sig/redis_queued_locks/acquirer/release_locks_of.rbs
131
+ - sig/redis_queued_locks/client.rbs
132
+ - sig/redis_queued_locks/config.rbs
133
+ - sig/redis_queued_locks/config/dsl.rbs
134
+ - sig/redis_queued_locks/data.rbs
135
+ - sig/redis_queued_locks/debugger.rbs
136
+ - sig/redis_queued_locks/debugger/interface.rbs
137
+ - sig/redis_queued_locks/errors.rbs
138
+ - sig/redis_queued_locks/instrument.rbs
139
+ - sig/redis_queued_locks/instrument/active_support.rbs
140
+ - sig/redis_queued_locks/instrument/sampler.rbs
141
+ - sig/redis_queued_locks/instrument/void_notifier.rbs
142
+ - sig/redis_queued_locks/logging.rbs
143
+ - sig/redis_queued_locks/logging/sampler.rbs
144
+ - sig/redis_queued_locks/logging/void_logger.rbs
145
+ - sig/redis_queued_locks/resource.rbs
146
+ - sig/redis_queued_locks/swarm.rbs
147
+ - sig/redis_queued_locks/swarm/acquirers.rbs
148
+ - sig/redis_queued_locks/swarm/flush_zombies.rbs
149
+ - sig/redis_queued_locks/swarm/probe_hosts.rbs
150
+ - sig/redis_queued_locks/swarm/redis_client_builder.rbs
151
+ - sig/redis_queued_locks/swarm/supervisor.rbs
152
+ - sig/redis_queued_locks/swarm/swarm_element.rbs
153
+ - sig/redis_queued_locks/swarm/swarm_element/isolated.rbs
154
+ - sig/redis_queued_locks/swarm/swarm_element/threaded.rbs
155
+ - sig/redis_queued_locks/swarm/zombie_info.rbs
156
+ - sig/redis_queued_locks/utilities.rbs
157
+ - sig/redis_queued_locks/utilities/lock.rbs
158
+ - sig/redis_queued_locks/version.rbs
159
+ - sig/vendor/active_support.rbs
160
+ - sig/vendor/redis_client.rbs
161
+ - sig/vendor/semantic_logger.rbs
116
162
  homepage: https://github.com/0exp/redis_queued_locks
117
163
  licenses:
118
164
  - MIT
@@ -120,7 +166,6 @@ metadata:
120
166
  homepage_uri: https://github.com/0exp/redis_queued_locks
121
167
  source_code_uri: https://github.com/0exp/redis_queued_locks/blob/master
122
168
  changelog_uri: https://github.com/0exp/redis_queued_locks/blob/master/CHANGELOG.md
123
- post_install_message:
124
169
  rdoc_options: []
125
170
  require_paths:
126
171
  - lib
@@ -128,15 +173,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
173
  requirements:
129
174
  - - ">="
130
175
  - !ruby/object:Gem::Version
131
- version: '3.1'
176
+ version: '3.3'
132
177
  required_rubygems_version: !ruby/object:Gem::Requirement
133
178
  requirements:
134
179
  - - ">="
135
180
  - !ruby/object:Gem::Version
136
181
  version: '0'
137
182
  requirements: []
138
- rubygems_version: 3.5.17
139
- signing_key:
183
+ rubygems_version: 3.6.9
140
184
  specification_version: 4
141
185
  summary: Distributed locks with "prioritized lock acquisition queue" capabilities
142
186
  based on the Redis Database.
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # @api private
4
- # @since 1.7.0
5
- module RedisQueuedLocks::Acquier::AcquireLock::DequeueFromLockQueue::LogVisitor
6
- extend self
7
-
8
- # @param logger [::Logger,#debug]
9
- # @param log_sampled [Boolean]
10
- # @param lock_key [String]
11
- # @param queue_ttl [Integer]
12
- # @param acquier_id [String]
13
- # @param host_id [String]
14
- # @param access_strategy [Symbol]
15
- # @return [void]
16
- #
17
- # @api private
18
- # @since 1.7.0
19
- # @version 1.9.0
20
- def dequeue_from_lock_queue(
21
- logger,
22
- log_sampled,
23
- lock_key,
24
- queue_ttl,
25
- acquier_id,
26
- host_id,
27
- access_strategy
28
- )
29
- return unless log_sampled
30
-
31
- logger.debug do
32
- "[redis_queued_locks.fail_fast_or_limits_reached_or_deadlock__dequeue] " \
33
- "lock_key => '#{lock_key}' " \
34
- "queue_ttl => #{queue_ttl} " \
35
- "acq_id => '#{acquier_id}' " \
36
- "hst_id => '#{host_id}' " \
37
- "acs_strat => '#{access_strategy}"
38
- end rescue nil
39
- end
40
- end