diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d9eb4..c5f88b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Changed - Updated development dependencies (`armitage-rubocop`); +- Constant renaming: all constants and constant parts were renamed from `Acquier` to `Acquirer`; ## Added - Type signatures (`RBS`, see the `sig` directory) + `Steep` integration (see `Steepfile` for details); @@ -21,7 +22,7 @@ ## [1.11.0] - 2024-08-11 ### Changed -- Lock Acquierment Timeout (`acq_timeout`/`queue_ttl`): more correct timeout error interception +- Lock Acquirement Timeout (`acq_timeout`/`queue_ttl`): more correct timeout error interception inside the `RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout` logic that now raises and intercepts an internal timeout error class in order to prevent interceptions of other timeouts that can be raised from the wrapped block of code; diff --git a/lib/redis_queued_locks.rb b/lib/redis_queued_locks.rb index 9400c7d..a5b861a 100644 --- a/lib/redis_queued_locks.rb +++ b/lib/redis_queued_locks.rb @@ -17,7 +17,7 @@ module RedisQueuedLocks require_relative 'redis_queued_locks/data' require_relative 'redis_queued_locks/debugger' require_relative 'redis_queued_locks/resource' - require_relative 'redis_queued_locks/acquier' + require_relative 'redis_queued_locks/acquirer' require_relative 'redis_queued_locks/instrument' require_relative 'redis_queued_locks/swarm' require_relative 'redis_queued_locks/client' diff --git a/lib/redis_queued_locks/acquier.rb b/lib/redis_queued_locks/acquier.rb deleted file mode 100644 index 413ac32..0000000 --- a/lib/redis_queued_locks/acquier.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# @api private -# @since 1.0.0 -module RedisQueuedLocks::Acquier - require_relative 'acquier/acquire_lock' - require_relative 'acquier/release_lock' - require_relative 'acquier/release_all_locks' - require_relative 'acquier/is_locked' - require_relative 'acquier/is_queued' - require_relative 'acquier/lock_info' - require_relative 'acquier/queue_info' - require_relative 'acquier/locks' - require_relative 'acquier/queues' - require_relative 'acquier/keys' - require_relative 'acquier/extend_lock_ttl' - require_relative 'acquier/clear_dead_requests' -end diff --git a/lib/redis_queued_locks/acquirer.rb b/lib/redis_queued_locks/acquirer.rb new file mode 100644 index 0000000..c3e384b --- /dev/null +++ b/lib/redis_queued_locks/acquirer.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# @api private +# @since 1.0.0 +module RedisQueuedLocks::Acquirer + require_relative 'acquirer/acquire_lock' + require_relative 'acquirer/release_lock' + require_relative 'acquirer/release_all_locks' + require_relative 'acquirer/is_locked' + require_relative 'acquirer/is_queued' + require_relative 'acquirer/lock_info' + require_relative 'acquirer/queue_info' + require_relative 'acquirer/locks' + require_relative 'acquirer/queues' + require_relative 'acquirer/keys' + require_relative 'acquirer/extend_lock_ttl' + require_relative 'acquirer/clear_dead_requests' +end diff --git a/lib/redis_queued_locks/acquier/acquire_lock.rb b/lib/redis_queued_locks/acquirer/acquire_lock.rb similarity index 99% rename from lib/redis_queued_locks/acquier/acquire_lock.rb rename to lib/redis_queued_locks/acquirer/acquire_lock.rb index e6fb6d6..318c26a 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock.rb @@ -8,7 +8,7 @@ # rubocop:disable Metrics/ClassLength # rubocop:disable Metrics/BlockNesting # rubocop:disable Style/IfInsideElse -module RedisQueuedLocks::Acquier::AcquireLock +module RedisQueuedLocks::Acquirer::AcquireLock require_relative 'acquire_lock/log_visitor' require_relative 'acquire_lock/instr_visitor' require_relative 'acquire_lock/delay_execution' diff --git a/lib/redis_queued_locks/acquier/acquire_lock/delay_execution.rb b/lib/redis_queued_locks/acquirer/acquire_lock/delay_execution.rb similarity index 88% rename from lib/redis_queued_locks/acquier/acquire_lock/delay_execution.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/delay_execution.rb index 42ede71..6e60cb9 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/delay_execution.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/delay_execution.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::AcquireLock::DelayExecution +module RedisQueuedLocks::Acquirer::AcquireLock::DelayExecution # Sleep with random time-shifting (it is necessary for empty lock-acquirement time slots). # # @param retry_delay [Integer] In milliseconds diff --git a/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rb b/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rb similarity index 93% rename from lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rb index ae93cac..e628120 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rb @@ -2,7 +2,7 @@ # @api private # @since 1.7.0 -module RedisQueuedLocks::Acquier::AcquireLock::DequeueFromLockQueue +module RedisQueuedLocks::Acquirer::AcquireLock::DequeueFromLockQueue require_relative 'dequeue_from_lock_queue/log_visitor' # @param redis [RedisClient] diff --git a/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb b/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb similarity index 92% rename from lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb index 2497c04..1759e52 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb @@ -2,7 +2,7 @@ # @api private # @since 1.7.0 -module RedisQueuedLocks::Acquier::AcquireLock::DequeueFromLockQueue::LogVisitor +module RedisQueuedLocks::Acquirer::AcquireLock::DequeueFromLockQueue::LogVisitor class << self # @param logger [::Logger,#debug] # @param log_sampled [Boolean] diff --git a/lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb b/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb similarity index 98% rename from lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb index b55d706..f26fccb 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb @@ -2,7 +2,7 @@ # @api private # @since 1.7.0 -module RedisQueuedLocks::Acquier::AcquireLock::InstrVisitor +module RedisQueuedLocks::Acquirer::AcquireLock::InstrVisitor class << self # @param instrumenter [#notify] # @param instr_sampled [Boolean] diff --git a/lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb b/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb similarity index 98% rename from lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb index 26388b0..03f3d82 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb @@ -3,7 +3,7 @@ # @api private # @since 1.7.0 # rubocop:disable Metrics/ModuleLength -module RedisQueuedLocks::Acquier::AcquireLock::LogVisitor +module RedisQueuedLocks::Acquirer::AcquireLock::LogVisitor # rubocop:disable Metrics/ClassLength class << self # @param logger [::Logger,#debug] diff --git a/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock.rb b/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb similarity index 99% rename from lib/redis_queued_locks/acquier/acquire_lock/try_to_lock.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb index 2441a63..1ecf039 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rb @@ -4,7 +4,7 @@ # @since 1.0.0 # @version 1.7.0 # rubocop:disable Metrics/ModuleLength -module RedisQueuedLocks::Acquier::AcquireLock::TryToLock +module RedisQueuedLocks::Acquirer::AcquireLock::TryToLock require_relative 'try_to_lock/log_visitor' # @return [String] diff --git a/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb b/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb similarity index 99% rename from lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb index 0a5e5f0..ae4dc89 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb @@ -3,7 +3,7 @@ # @api private # @since 1.7.0 # rubocop:disable Metrics/ModuleLength -module RedisQueuedLocks::Acquier::AcquireLock::TryToLock::LogVisitor +module RedisQueuedLocks::Acquirer::AcquireLock::TryToLock::LogVisitor # rubocop:disable Metrics/ClassLength class << self # @param logger [::Logger,#debug] diff --git a/lib/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rb b/lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb similarity index 91% rename from lib/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb index 1fc3ae0..888d398 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout +module RedisQueuedLocks::Acquirer::AcquireLock::WithAcqTimeout # @param redis [RedisClient] # Redis connection manager required for additional data extraction for error message. # @param timeout [NilClass,Integer] @@ -47,8 +47,8 @@ def with_acq_timeout( # TODO: rewrite these invocations to separated inner-AcquireLock-related modules # in order to remove any dependencies from the other public RQL commands cuz # all AcquireLock logic elements should be fully independent from others as a core; - lock_info = RedisQueuedLocks::Acquier::LockInfo.lock_info(redis, lock_name) - queue_info = RedisQueuedLocks::Acquier::QueueInfo.queue_info(redis, lock_name) + lock_info = RedisQueuedLocks::Acquirer::LockInfo.lock_info(redis, lock_name) + queue_info = RedisQueuedLocks::Acquirer::QueueInfo.queue_info(redis, lock_name) # rubocop:disable Metrics/BlockNesting raise( diff --git a/lib/redis_queued_locks/acquier/acquire_lock/yield_expire.rb b/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb similarity index 97% rename from lib/redis_queued_locks/acquier/acquire_lock/yield_expire.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb index f347366..c5fa245 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/yield_expire.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire.rb @@ -3,7 +3,7 @@ # @api private # @since 1.3.0 # @version 1.7.0 -module RedisQueuedLocks::Acquier::AcquireLock::YieldExpire +module RedisQueuedLocks::Acquirer::AcquireLock::YieldExpire require_relative 'yield_expire/log_visitor' # @return [String] @@ -18,7 +18,7 @@ module RedisQueuedLocks::Acquier::AcquireLock::YieldExpire # @param redis [RedisClient] Redis connection. # @param logger [::Logger,#debug] Logger object. # @param lock_key [String] Obtained lock key that should be expired. - # @param acquier_id [String] Acquier identifier. + # @param acquier_id [String] Acquirer identifier. # @param host_id [String] Host identifier. # @param access_strategy [Symbol] Lock obtaining strategy. # @param timed [Boolean] Should the lock be wrapped by Timeout with with lock's ttl diff --git a/lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb b/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb similarity index 96% rename from lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb rename to lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb index ab6adc8..8dbfd51 100644 --- a/lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb +++ b/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb @@ -2,7 +2,7 @@ # @api private # @since 1.7.0 -module RedisQueuedLocks::Acquier::AcquireLock::YieldExpire::LogVisitor +module RedisQueuedLocks::Acquirer::AcquireLock::YieldExpire::LogVisitor class << self # @param logger [::Logger,#debug] # @param log_sampled [Boolean] diff --git a/lib/redis_queued_locks/acquier/clear_dead_requests.rb b/lib/redis_queued_locks/acquirer/clear_dead_requests.rb similarity index 97% rename from lib/redis_queued_locks/acquier/clear_dead_requests.rb rename to lib/redis_queued_locks/acquirer/clear_dead_requests.rb index 0a93338..1422191 100644 --- a/lib/redis_queued_locks/acquier/clear_dead_requests.rb +++ b/lib/redis_queued_locks/acquirer/clear_dead_requests.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::ClearDeadRequests +module RedisQueuedLocks::Acquirer::ClearDeadRequests class << self # @param redis_client [RedisClient] # @param scan_size [Integer] diff --git a/lib/redis_queued_locks/acquier/extend_lock_ttl.rb b/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb similarity index 97% rename from lib/redis_queued_locks/acquier/extend_lock_ttl.rb rename to lib/redis_queued_locks/acquirer/extend_lock_ttl.rb index dcc2462..ad058a1 100644 --- a/lib/redis_queued_locks/acquier/extend_lock_ttl.rb +++ b/lib/redis_queued_locks/acquirer/extend_lock_ttl.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::ExtendLockTTL +module RedisQueuedLocks::Acquirer::ExtendLockTTL # @return [String] # # @api private diff --git a/lib/redis_queued_locks/acquier/is_locked.rb b/lib/redis_queued_locks/acquirer/is_locked.rb similarity index 90% rename from lib/redis_queued_locks/acquier/is_locked.rb rename to lib/redis_queued_locks/acquirer/is_locked.rb index 7ccaac2..712fd77 100644 --- a/lib/redis_queued_locks/acquier/is_locked.rb +++ b/lib/redis_queued_locks/acquirer/is_locked.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::IsLocked +module RedisQueuedLocks::Acquirer::IsLocked class << self # @param redis_client [RedisClient] # @param lock_name [String] diff --git a/lib/redis_queued_locks/acquier/is_queued.rb b/lib/redis_queued_locks/acquirer/is_queued.rb similarity index 90% rename from lib/redis_queued_locks/acquier/is_queued.rb rename to lib/redis_queued_locks/acquirer/is_queued.rb index f270ab0..eace441 100644 --- a/lib/redis_queued_locks/acquier/is_queued.rb +++ b/lib/redis_queued_locks/acquirer/is_queued.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::IsQueued +module RedisQueuedLocks::Acquirer::IsQueued class << self # @param redis_client [RedisClient] # @param lock_name [String] diff --git a/lib/redis_queued_locks/acquier/keys.rb b/lib/redis_queued_locks/acquirer/keys.rb similarity index 93% rename from lib/redis_queued_locks/acquier/keys.rb rename to lib/redis_queued_locks/acquirer/keys.rb index c14e861..d71764a 100644 --- a/lib/redis_queued_locks/acquier/keys.rb +++ b/lib/redis_queued_locks/acquirer/keys.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::Keys +module RedisQueuedLocks::Acquirer::Keys class << self # @param redis_client [RedisClient] # @option scan_size [Integer] diff --git a/lib/redis_queued_locks/acquier/lock_info.rb b/lib/redis_queued_locks/acquirer/lock_info.rb similarity index 98% rename from lib/redis_queued_locks/acquier/lock_info.rb rename to lib/redis_queued_locks/acquirer/lock_info.rb index 453ca1a..7255885 100644 --- a/lib/redis_queued_locks/acquier/lock_info.rb +++ b/lib/redis_queued_locks/acquirer/lock_info.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::LockInfo +module RedisQueuedLocks::Acquirer::LockInfo class << self # @param redis_client [RedisClient] # @param lock_name [String] diff --git a/lib/redis_queued_locks/acquier/locks.rb b/lib/redis_queued_locks/acquirer/locks.rb similarity index 99% rename from lib/redis_queued_locks/acquier/locks.rb rename to lib/redis_queued_locks/acquirer/locks.rb index 6a72d58..240b455 100644 --- a/lib/redis_queued_locks/acquier/locks.rb +++ b/lib/redis_queued_locks/acquirer/locks.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::Locks +module RedisQueuedLocks::Acquirer::Locks class << self # @param redis_client [RedisClient] # @option scan_size [Integer] diff --git a/lib/redis_queued_locks/acquier/queue_info.rb b/lib/redis_queued_locks/acquirer/queue_info.rb similarity index 97% rename from lib/redis_queued_locks/acquier/queue_info.rb rename to lib/redis_queued_locks/acquirer/queue_info.rb index 6f5a805..2d1d111 100644 --- a/lib/redis_queued_locks/acquier/queue_info.rb +++ b/lib/redis_queued_locks/acquirer/queue_info.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::QueueInfo +module RedisQueuedLocks::Acquirer::QueueInfo class << self # Returns an information about the required lock queue by the lock name. The result # represnts the ordered lock request queue that is ordered by score (Redis sets) and shows diff --git a/lib/redis_queued_locks/acquier/queues.rb b/lib/redis_queued_locks/acquirer/queues.rb similarity index 98% rename from lib/redis_queued_locks/acquier/queues.rb rename to lib/redis_queued_locks/acquirer/queues.rb index e70e9e4..84dde2d 100644 --- a/lib/redis_queued_locks/acquier/queues.rb +++ b/lib/redis_queued_locks/acquirer/queues.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::Queues +module RedisQueuedLocks::Acquirer::Queues class << self # @param redis_client [RedisClient] # @option scan_size [Integer] diff --git a/lib/redis_queued_locks/acquier/release_all_locks.rb b/lib/redis_queued_locks/acquirer/release_all_locks.rb similarity index 99% rename from lib/redis_queued_locks/acquier/release_all_locks.rb rename to lib/redis_queued_locks/acquirer/release_all_locks.rb index 9d8cdb8..8258c22 100644 --- a/lib/redis_queued_locks/acquier/release_all_locks.rb +++ b/lib/redis_queued_locks/acquirer/release_all_locks.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::ReleaseAllLocks +module RedisQueuedLocks::Acquirer::ReleaseAllLocks # @since 1.0.0 extend RedisQueuedLocks::Utilities diff --git a/lib/redis_queued_locks/acquier/release_lock.rb b/lib/redis_queued_locks/acquirer/release_lock.rb similarity index 99% rename from lib/redis_queued_locks/acquier/release_lock.rb rename to lib/redis_queued_locks/acquirer/release_lock.rb index 40f4648..3e08687 100644 --- a/lib/redis_queued_locks/acquier/release_lock.rb +++ b/lib/redis_queued_locks/acquirer/release_lock.rb @@ -2,7 +2,7 @@ # @api private # @since 1.0.0 -module RedisQueuedLocks::Acquier::ReleaseLock +module RedisQueuedLocks::Acquirer::ReleaseLock # @since 1.0.0 extend RedisQueuedLocks::Utilities diff --git a/lib/redis_queued_locks/client.rb b/lib/redis_queued_locks/client.rb index deff4c8..bb9a5ad 100644 --- a/lib/redis_queued_locks/client.rb +++ b/lib/redis_queued_locks/client.rb @@ -438,7 +438,7 @@ def lock( instr_sample_this: false, &block ) - RedisQueuedLocks::Acquier::AcquireLock.acquire_lock( + RedisQueuedLocks::Acquirer::AcquireLock.acquire_lock( redis_client, lock_name, process_id: RedisQueuedLocks::Resource.get_process_id, @@ -585,7 +585,7 @@ def unlock( instr_sampler: config[:instr_sampler], # steep:ignore instr_sample_this: false ) - RedisQueuedLocks::Acquier::ReleaseLock.release_lock( + RedisQueuedLocks::Acquirer::ReleaseLock.release_lock( redis_client, lock_name, instrumenter, @@ -608,7 +608,7 @@ def unlock( # @api public # @since 1.0.0 def locked?(lock_name) - RedisQueuedLocks::Acquier::IsLocked.locked?(redis_client, lock_name) + RedisQueuedLocks::Acquirer::IsLocked.locked?(redis_client, lock_name) end # @param lock_name [String] @@ -617,7 +617,7 @@ def locked?(lock_name) # @api public # @since 1.0.0 def queued?(lock_name) - RedisQueuedLocks::Acquier::IsQueued.queued?(redis_client, lock_name) + RedisQueuedLocks::Acquirer::IsQueued.queued?(redis_client, lock_name) end # @param lock_name [String] @@ -626,7 +626,7 @@ def queued?(lock_name) # @api public # @since 1.0.0 def lock_info(lock_name) - RedisQueuedLocks::Acquier::LockInfo.lock_info(redis_client, lock_name) + RedisQueuedLocks::Acquirer::LockInfo.lock_info(redis_client, lock_name) end # @param lock_name [String] @@ -635,7 +635,7 @@ def lock_info(lock_name) # @api public # @since 1.0.0 def queue_info(lock_name) - RedisQueuedLocks::Acquier::QueueInfo.queue_info(redis_client, lock_name) + RedisQueuedLocks::Acquirer::QueueInfo.queue_info(redis_client, lock_name) end # Retrun the current acquirer identifier. @@ -760,7 +760,7 @@ def extend_lock_ttl( instr_sampler: config[:instr_sampler], # steep:ignore instr_sample_this: false ) - RedisQueuedLocks::Acquier::ExtendLockTTL.extend_lock_ttl( + RedisQueuedLocks::Acquirer::ExtendLockTTL.extend_lock_ttl( redis_client, lock_name, milliseconds, @@ -815,7 +815,7 @@ def clear_locks( instr_sampler: config[:instr_sampler], # steep:ignore instr_sample_this: false ) - RedisQueuedLocks::Acquier::ReleaseAllLocks.release_all_locks( + RedisQueuedLocks::Acquirer::ReleaseAllLocks.release_all_locks( redis_client, batch_size, logger, @@ -853,7 +853,7 @@ def clear_locks( # @api public # @since 1.0.0 def locks(scan_size: config[:key_extraction_batch_size], with_info: false) # steep:ignore - RedisQueuedLocks::Acquier::Locks.locks(redis_client, scan_size:, with_info:) + RedisQueuedLocks::Acquirer::Locks.locks(redis_client, scan_size:, with_info:) end # Extracts lock keys with their info. See #locks(with_info: true) for details. @@ -884,7 +884,7 @@ def locks_info(scan_size: config[:key_extraction_batch_size]) # steep:ignore # @api public # @since 1.0.0 def queues(scan_size: config[:key_extraction_batch_size], with_info: false) # steep:ignore - RedisQueuedLocks::Acquier::Queues.queues(redis_client, scan_size:, with_info:) + RedisQueuedLocks::Acquirer::Queues.queues(redis_client, scan_size:, with_info:) end # Extracts lock queues with their info. See #queues(with_info: true) for details. @@ -904,7 +904,7 @@ def queues_info(scan_size: config[:key_extraction_batch_size]) # steep:ignore # @api public # @since 1.0.0 def keys(scan_size: config[:key_extraction_batch_size]) # steep:ignore - RedisQueuedLocks::Acquier::Keys.keys(redis_client, scan_size:) + RedisQueuedLocks::Acquirer::Keys.keys(redis_client, scan_size:) end # @option dead_ttl [Integer] @@ -946,7 +946,7 @@ def clear_dead_requests( instr_sampler: config[:instr_sampler], # steep:ignore instr_sample_this: false ) - RedisQueuedLocks::Acquier::ClearDeadRequests.clear_dead_requests( + RedisQueuedLocks::Acquirer::ClearDeadRequests.clear_dead_requests( redis_client, scan_size, dead_ttl, diff --git a/lib/redis_queued_locks/utilities.rb b/lib/redis_queued_locks/utilities.rb index dc8decb..3c3da8a 100644 --- a/lib/redis_queued_locks/utilities.rb +++ b/lib/redis_queued_locks/utilities.rb @@ -49,7 +49,6 @@ def run_non_critical(&block) # - "blocking" # - "running" # - "terminated" - # - "unknown" # # @param ractor [Ractor] # @return [String] diff --git a/sig/redis_queued_locks.rbs b/sig/redis_queued_locks.rbs index 81ba694..597d045 100644 --- a/sig/redis_queued_locks.rbs +++ b/sig/redis_queued_locks.rbs @@ -4,7 +4,7 @@ module RedisQueuedLocks end interface _Instrumentable - def notify: (::String event, ?::Hash[String|Symbol,untyped] payload) -> void + def notify: (::String event, ?::Hash[untyped,untyped] payload) -> void end extend ::RedisQueuedLocks::Debugger::Interface diff --git a/sig/redis_queued_locks/acquier.rbs b/sig/redis_queued_locks/acquier.rbs index b47c352..2487b06 100644 --- a/sig/redis_queued_locks/acquier.rbs +++ b/sig/redis_queued_locks/acquier.rbs @@ -1,4 +1,4 @@ module RedisQueuedLocks - module Acquier + module Acquirer end end diff --git a/sig/redis_queued_locks/acquier/acquire_lock.rbs b/sig/redis_queued_locks/acquirer/acquire_lock.rbs similarity index 77% rename from sig/redis_queued_locks/acquier/acquire_lock.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock.rbs index 5a9fe75..058ca68 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock.rbs @@ -1,11 +1,11 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock - extend ::RedisQueuedLocks::Acquier::AcquireLock::TryToLock - extend ::RedisQueuedLocks::Acquier::AcquireLock::DelayExecution - extend ::RedisQueuedLocks::Acquier::AcquireLock::YieldExpire - extend ::RedisQueuedLocks::Acquier::AcquireLock::WithAcqTimeout - extend ::RedisQueuedLocks::Acquier::AcquireLock::DequeueFromLockQueue + extend ::RedisQueuedLocks::Acquirer::AcquireLock::TryToLock + extend ::RedisQueuedLocks::Acquirer::AcquireLock::DelayExecution + extend ::RedisQueuedLocks::Acquirer::AcquireLock::YieldExpire + extend ::RedisQueuedLocks::Acquirer::AcquireLock::WithAcqTimeout + extend ::RedisQueuedLocks::Acquirer::AcquireLock::DequeueFromLockQueue def self.acquire_lock: ( ::RedisClient redis, diff --git a/sig/redis_queued_locks/acquier/acquire_lock/delay_execution.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs similarity index 91% rename from sig/redis_queued_locks/acquier/acquire_lock/delay_execution.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs index 55dcc4b..055ae5e 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/delay_execution.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module DelayExecution def delay_execution: (::Integer retry_delay, ::Integer retry_jitter) -> void diff --git a/sig/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs similarity index 96% rename from sig/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs index 9cb04a9..4cfb1f8 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module DequeueFromLockQueue def dequeue_from_lock_queue: ( diff --git a/sig/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs similarity index 96% rename from sig/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs index 6d003f3..095552e 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module DequeueFromLockQueue module LogVisitor diff --git a/sig/redis_queued_locks/acquier/acquire_lock/instr_visitor.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs similarity index 99% rename from sig/redis_queued_locks/acquier/acquire_lock/instr_visitor.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs index 2c51d09..0718c5d 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/instr_visitor.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module InstrVisitor def self.extendable_reentrant_lock_obtained: ( diff --git a/sig/redis_queued_locks/acquier/acquire_lock/log_visitor.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs similarity index 99% rename from sig/redis_queued_locks/acquier/acquire_lock/log_visitor.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs index 620d551..d228648 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/log_visitor.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module LogVisitor def self.start_lock_obtaining: ( diff --git a/sig/redis_queued_locks/acquier/acquire_lock/try_to_lock.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/acquire_lock/try_to_lock.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs index 1406212..f300756 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/try_to_lock.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module TryToLock EXTEND_LOCK_PTTL: ::String diff --git a/sig/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs similarity index 99% rename from sig/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs index a695a75..6c6d304 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module TryToLock module LogVisitor diff --git a/sig/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs similarity index 95% rename from sig/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs index 0f26773..02b33c8 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/with_acq_timeout.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module WithAcqTimeout def with_acq_timeout: ( diff --git a/sig/redis_queued_locks/acquier/acquire_lock/yield_expire.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs similarity index 98% rename from sig/redis_queued_locks/acquier/acquire_lock/yield_expire.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs index c0b1435..24f5ce5 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/yield_expire.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module YieldExpire DECREASE_LOCK_PTTL: ::String diff --git a/sig/redis_queued_locks/acquier/acquire_lock/yield_with_expire/log_visitor.rbs b/sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/acquire_lock/yield_with_expire/log_visitor.rbs rename to sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs index 014e5e5..24722a3 100644 --- a/sig/redis_queued_locks/acquier/acquire_lock/yield_with_expire/log_visitor.rbs +++ b/sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module AcquireLock module YieldExpire module LogVisitor diff --git a/sig/redis_queued_locks/acquier/clear_dead_requests.rbs b/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/clear_dead_requests.rbs rename to sig/redis_queued_locks/acquirer/clear_dead_requests.rbs index e3e790f..12c749a 100644 --- a/sig/redis_queued_locks/acquier/clear_dead_requests.rbs +++ b/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module ClearDeadRequests def self.clear_dead_requests: ( ::RedisClient redis_client, diff --git a/sig/redis_queued_locks/acquier/extend_lock_ttl.rbs b/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/extend_lock_ttl.rbs rename to sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs index 2e3646e..702fe72 100644 --- a/sig/redis_queued_locks/acquier/extend_lock_ttl.rbs +++ b/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module ExtendLockTTL EXTEND_LOCK_PTTL: ::String diff --git a/sig/redis_queued_locks/acquier/is_locked.rbs b/sig/redis_queued_locks/acquirer/is_locked.rbs similarity index 88% rename from sig/redis_queued_locks/acquier/is_locked.rbs rename to sig/redis_queued_locks/acquirer/is_locked.rbs index ea50676..2b255b6 100644 --- a/sig/redis_queued_locks/acquier/is_locked.rbs +++ b/sig/redis_queued_locks/acquirer/is_locked.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module IsLocked def self.locked?: (::RedisClient redis_client, ::String lock_name) -> bool end diff --git a/sig/redis_queued_locks/acquier/is_queued.rbs b/sig/redis_queued_locks/acquirer/is_queued.rbs similarity index 88% rename from sig/redis_queued_locks/acquier/is_queued.rbs rename to sig/redis_queued_locks/acquirer/is_queued.rbs index 07c76b5..4cd65fd 100644 --- a/sig/redis_queued_locks/acquier/is_queued.rbs +++ b/sig/redis_queued_locks/acquirer/is_queued.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module IsQueued def self.queued?: (::RedisClient redis_client, ::String lock_name) -> bool end diff --git a/sig/redis_queued_locks/acquier/keys.rbs b/sig/redis_queued_locks/acquirer/keys.rbs similarity index 89% rename from sig/redis_queued_locks/acquier/keys.rbs rename to sig/redis_queued_locks/acquirer/keys.rbs index 64645c0..c3b89ce 100644 --- a/sig/redis_queued_locks/acquier/keys.rbs +++ b/sig/redis_queued_locks/acquirer/keys.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module Keys def self.keys: (::RedisClient redis_client, scan_size: ::Integer) -> ::Set[::String] end diff --git a/sig/redis_queued_locks/acquier/lock_info.rbs b/sig/redis_queued_locks/acquirer/lock_info.rbs similarity index 92% rename from sig/redis_queued_locks/acquier/lock_info.rbs rename to sig/redis_queued_locks/acquirer/lock_info.rbs index 7486f89..16a2e2b 100644 --- a/sig/redis_queued_locks/acquier/lock_info.rbs +++ b/sig/redis_queued_locks/acquirer/lock_info.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module LockInfo def self.lock_info: ( ::RedisClient redis_client, diff --git a/sig/redis_queued_locks/acquier/locks.rbs b/sig/redis_queued_locks/acquirer/locks.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/locks.rbs rename to sig/redis_queued_locks/acquirer/locks.rbs index 9773583..aa6e398 100644 --- a/sig/redis_queued_locks/acquier/locks.rbs +++ b/sig/redis_queued_locks/acquirer/locks.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module Locks def self.locks: ( ::RedisClient redis_client, diff --git a/sig/redis_queued_locks/acquier/queue_info.rbs b/sig/redis_queued_locks/acquirer/queue_info.rbs similarity index 93% rename from sig/redis_queued_locks/acquier/queue_info.rbs rename to sig/redis_queued_locks/acquirer/queue_info.rbs index a605f59..41a18b9 100644 --- a/sig/redis_queued_locks/acquier/queue_info.rbs +++ b/sig/redis_queued_locks/acquirer/queue_info.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module QueueInfo def self.queue_info: ( ::RedisClient redis_client, diff --git a/sig/redis_queued_locks/acquier/queues.rbs b/sig/redis_queued_locks/acquirer/queues.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/queues.rbs rename to sig/redis_queued_locks/acquirer/queues.rbs index 66f1587..52bce6a 100644 --- a/sig/redis_queued_locks/acquier/queues.rbs +++ b/sig/redis_queued_locks/acquirer/queues.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module Queues def self.queues: ( ::RedisClient redis_client, diff --git a/sig/redis_queued_locks/acquier/release_all_locks.rbs b/sig/redis_queued_locks/acquirer/release_all_locks.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/release_all_locks.rbs rename to sig/redis_queued_locks/acquirer/release_all_locks.rbs index 2653005..feeb1c8 100644 --- a/sig/redis_queued_locks/acquier/release_all_locks.rbs +++ b/sig/redis_queued_locks/acquirer/release_all_locks.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module ReleaseAllLocks extend ::RedisQueuedLocks::Utilities diff --git a/sig/redis_queued_locks/acquier/release_lock.rbs b/sig/redis_queued_locks/acquirer/release_lock.rbs similarity index 97% rename from sig/redis_queued_locks/acquier/release_lock.rbs rename to sig/redis_queued_locks/acquirer/release_lock.rbs index 5488d04..859b535 100644 --- a/sig/redis_queued_locks/acquier/release_lock.rbs +++ b/sig/redis_queued_locks/acquirer/release_lock.rbs @@ -1,5 +1,5 @@ module RedisQueuedLocks - module Acquier + module Acquirer module ReleaseLock extend ::RedisQueuedLocks::Utilities diff --git a/sig/redis_queued_locks/logging/void_logger.rbs b/sig/redis_queued_locks/logging/void_logger.rbs index bbe7f52..3cb2a6a 100644 --- a/sig/redis_queued_locks/logging/void_logger.rbs +++ b/sig/redis_queued_locks/logging/void_logger.rbs @@ -8,7 +8,7 @@ module RedisQueuedLocks def self.error: (?untyped? progname) { (?) -> untyped } -> nil def self.fatal: (?untyped? progname) { (?) -> untyped } -> nil def self.debug: (?untyped? progname) { (?) -> untyped } -> nil - def self.add: (?untyped? severity, ?untyped? message, ?untyped? progname) { (?) -> untyped } -> nil + def self.add: (?untyped? severity, ?untyped? message, ?untyped? progname) { (?) -> untyped } -> nil def self.<<: (untyped message) -> nil end end