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.
- checksums.yaml +4 -4
 - data/.rubocop.yml +3 -1
 - data/.ruby-version +1 -1
 - data/CHANGELOG.md +45 -5
 - data/LICENSE.txt +1 -1
 - data/README.md +574 -296
 - data/Rakefile +12 -4
 - data/Steepfile +15 -0
 - data/github_ci/ruby3.3.gemfile +17 -0
 - data/github_ci/ruby3.3.gemfile.lock +217 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/delay_execution.rb +4 -4
 - data/lib/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +40 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/dequeue_from_lock_queue.rb +17 -8
 - data/lib/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rb +166 -0
 - data/lib/redis_queued_locks/acquirer/acquire_lock/log_visitor.rb +218 -0
 - data/lib/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rb +543 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/try_to_lock.rb +126 -92
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/with_acq_timeout.rb +14 -9
 - data/lib/redis_queued_locks/acquirer/acquire_lock/yield_expire/log_visitor.rb +76 -0
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock/yield_expire.rb +42 -19
 - data/lib/redis_queued_locks/{acquier → acquirer}/acquire_lock.rb +74 -47
 - data/lib/redis_queued_locks/{acquier → acquirer}/clear_dead_requests.rb +5 -3
 - data/lib/redis_queued_locks/{acquier → acquirer}/extend_lock_ttl.rb +4 -3
 - data/lib/redis_queued_locks/{acquier → acquirer}/is_locked.rb +1 -1
 - data/lib/redis_queued_locks/{acquier → acquirer}/is_queued.rb +1 -1
 - data/lib/redis_queued_locks/{acquier → acquirer}/keys.rb +5 -5
 - data/lib/redis_queued_locks/{acquier → acquirer}/lock_info.rb +9 -5
 - data/lib/redis_queued_locks/{acquier → acquirer}/locks.rb +16 -3
 - data/lib/redis_queued_locks/{acquier → acquirer}/queue_info.rb +8 -6
 - data/lib/redis_queued_locks/{acquier → acquirer}/queues.rb +9 -2
 - data/lib/redis_queued_locks/{acquier → acquirer}/release_all_locks.rb +26 -21
 - data/lib/redis_queued_locks/{acquier → acquirer}/release_lock.rb +28 -22
 - data/lib/redis_queued_locks/acquirer/release_locks_of.rb +211 -0
 - data/lib/redis_queued_locks/acquirer.rb +19 -0
 - data/lib/redis_queued_locks/client.rb +317 -254
 - data/lib/redis_queued_locks/config/dsl.rb +94 -0
 - data/lib/redis_queued_locks/config.rb +236 -0
 - data/lib/redis_queued_locks/data.rb +2 -0
 - data/lib/redis_queued_locks/errors.rb +27 -11
 - data/lib/redis_queued_locks/instrument.rb +11 -4
 - data/lib/redis_queued_locks/logging/void_logger.rb +38 -1
 - data/lib/redis_queued_locks/logging.rb +20 -5
 - data/lib/redis_queued_locks/resource.rb +49 -11
 - data/lib/redis_queued_locks/swarm/acquirers.rb +17 -16
 - data/lib/redis_queued_locks/swarm/flush_zombies.rb +26 -25
 - data/lib/redis_queued_locks/swarm/probe_hosts.rb +20 -19
 - data/lib/redis_queued_locks/swarm/redis_client_builder.rb +3 -3
 - data/lib/redis_queued_locks/swarm/supervisor.rb +19 -6
 - data/lib/redis_queued_locks/swarm/swarm_element/isolated.rb +20 -18
 - data/lib/redis_queued_locks/swarm/swarm_element/threaded.rb +35 -27
 - data/lib/redis_queued_locks/swarm/zombie_info.rb +9 -9
 - data/lib/redis_queued_locks/swarm.rb +20 -41
 - data/lib/redis_queued_locks/utilities.rb +11 -2
 - data/lib/redis_queued_locks/version.rb +2 -2
 - data/lib/redis_queued_locks.rb +2 -3
 - data/rbs_collection.lock.yaml +28 -0
 - data/rbs_collection.yaml +17 -0
 - data/redis_queued_locks.gemspec +22 -23
 - data/sig/manifest.yml +6 -0
 - data/sig/redis_queued_locks/acquier.rbs +4 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/delay_execution.rbs +9 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue/log_visitor.rbs +21 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/dequeue_from_lock_queue.rbs +26 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/instr_visitor.rbs +71 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/log_visitor.rbs +72 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock/log_visitor.rbs +179 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/try_to_lock.rbs +48 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/with_acq_timeout.rbs +19 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/yield_expire.rbs +41 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock/yield_with_expire/log_visitor.rbs +32 -0
 - data/sig/redis_queued_locks/acquirer/acquire_lock.rbs +52 -0
 - data/sig/redis_queued_locks/acquirer/clear_dead_requests.rbs +28 -0
 - data/sig/redis_queued_locks/acquirer/extend_lock_ttl.rbs +28 -0
 - data/sig/redis_queued_locks/acquirer/is_locked.rbs +9 -0
 - data/sig/redis_queued_locks/acquirer/is_queued.rbs +9 -0
 - data/sig/redis_queued_locks/acquirer/keys.rbs +10 -0
 - data/sig/redis_queued_locks/acquirer/lock_info.rbs +10 -0
 - data/sig/redis_queued_locks/acquirer/locks.rbs +16 -0
 - data/sig/redis_queued_locks/acquirer/queue_info.rbs +13 -0
 - data/sig/redis_queued_locks/acquirer/queues.rbs +16 -0
 - data/sig/redis_queued_locks/acquirer/release_all_locks.rbs +30 -0
 - data/sig/redis_queued_locks/acquirer/release_lock.rbs +38 -0
 - data/sig/redis_queued_locks/acquirer/release_locks_of.rbs +46 -0
 - data/sig/redis_queued_locks/client.rbs +235 -0
 - data/sig/redis_queued_locks/config/dsl.rbs +26 -0
 - data/sig/redis_queued_locks/config.rbs +23 -0
 - data/sig/redis_queued_locks/data.rbs +4 -0
 - data/sig/redis_queued_locks/debugger/interface.rbs +9 -0
 - data/sig/redis_queued_locks/debugger.rbs +13 -0
 - data/sig/redis_queued_locks/errors.rbs +43 -0
 - data/sig/redis_queued_locks/instrument/active_support.rbs +7 -0
 - data/sig/redis_queued_locks/instrument/sampler.rbs +9 -0
 - data/sig/redis_queued_locks/instrument/void_notifier.rbs +7 -0
 - data/sig/redis_queued_locks/instrument.rbs +15 -0
 - data/sig/redis_queued_locks/logging/sampler.rbs +9 -0
 - data/sig/redis_queued_locks/logging/void_logger.rbs +15 -0
 - data/sig/redis_queued_locks/logging.rbs +15 -0
 - data/sig/redis_queued_locks/resource.rbs +42 -0
 - data/sig/redis_queued_locks/swarm/acquirers.rbs +10 -0
 - data/sig/redis_queued_locks/swarm/flush_zombies.rbs +13 -0
 - data/sig/redis_queued_locks/swarm/probe_hosts.rbs +13 -0
 - data/sig/redis_queued_locks/swarm/redis_client_builder.rbs +19 -0
 - data/sig/redis_queued_locks/swarm/supervisor.rbs +26 -0
 - data/sig/redis_queued_locks/swarm/swarm_element/isolated.rbs +52 -0
 - data/sig/redis_queued_locks/swarm/swarm_element/threaded.rbs +61 -0
 - data/sig/redis_queued_locks/swarm/swarm_element.rbs +8 -0
 - data/sig/redis_queued_locks/swarm/zombie_info.rbs +24 -0
 - data/sig/redis_queued_locks/swarm.rbs +41 -0
 - data/sig/redis_queued_locks/utilities/lock.rbs +10 -0
 - data/sig/redis_queued_locks/utilities.rbs +12 -0
 - data/sig/redis_queued_locks/version.rbs +3 -0
 - data/sig/redis_queued_locks.rbs +14 -0
 - data/sig/vendor/active_support.rbs +9 -0
 - data/sig/vendor/redis_client.rbs +39 -0
 - data/sig/vendor/semantic_logger.rbs +4 -0
 - metadata +98 -54
 - data/lib/redis_queued_locks/acquier/acquire_lock/dequeue_from_lock_queue/log_visitor.rb +0 -40
 - data/lib/redis_queued_locks/acquier/acquire_lock/instr_visitor.rb +0 -166
 - data/lib/redis_queued_locks/acquier/acquire_lock/log_visitor.rb +0 -216
 - data/lib/redis_queued_locks/acquier/acquire_lock/try_to_lock/log_visitor.rb +0 -541
 - data/lib/redis_queued_locks/acquier/acquire_lock/yield_expire/log_visitor.rb +0 -76
 - data/lib/redis_queued_locks/acquier.rb +0 -18
 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisQueuedLocks as RQL
         
     | 
| 
      
 2 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Acquirer
         
     | 
| 
      
 6 
     | 
    
         
            +
                module ReleaseAllLocks
         
     | 
| 
      
 7 
     | 
    
         
            +
                  extend RQL::Utilities
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  type releaseResult = { ok: bool, result: { rel_key_cnt: Integer, rel_time: Integer|Float } }
         
     | 
| 
      
 10 
     | 
    
         
            +
                  def self.release_all_locks: (
         
     | 
| 
      
 11 
     | 
    
         
            +
                    RC::client redis,
         
     | 
| 
      
 12 
     | 
    
         
            +
                    Integer batch_size,
         
     | 
| 
      
 13 
     | 
    
         
            +
                    RQL::loggerObj logger,
         
     | 
| 
      
 14 
     | 
    
         
            +
                    RQL::instrObj instrumenter,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    untyped instrument,
         
     | 
| 
      
 16 
     | 
    
         
            +
                    bool log_sampling_enabled,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    Integer log_sampling_percent,
         
     | 
| 
      
 18 
     | 
    
         
            +
                    RQL::Logging::samplerObj log_sampler,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    bool log_sample_this,
         
     | 
| 
      
 20 
     | 
    
         
            +
                    bool instr_sampling_enabled,
         
     | 
| 
      
 21 
     | 
    
         
            +
                    Integer instr_sampling_percent,
         
     | 
| 
      
 22 
     | 
    
         
            +
                    RQL::Instrument::samplerObj instr_sampler,
         
     | 
| 
      
 23 
     | 
    
         
            +
                    bool instr_sample_this
         
     | 
| 
      
 24 
     | 
    
         
            +
                  ) -> releaseResult
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                  type fullRelesaeResult = { ok: bool, result: { rel_key_cnt: Integer } }
         
     | 
| 
      
 27 
     | 
    
         
            +
                  private def self.fully_release_all_locks: (RC::client redis, Integer batch_size) -> fullRelesaeResult
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
      
 29 
     | 
    
         
            +
              end
         
     | 
| 
      
 30 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,38 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisQueuedLocks as RQL
         
     | 
| 
      
 2 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Acquirer
         
     | 
| 
      
 6 
     | 
    
         
            +
                module ReleaseLock
         
     | 
| 
      
 7 
     | 
    
         
            +
                  extend RQL::Utilities
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  type releaseResult = {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    ok: bool,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    result: {
         
     | 
| 
      
 12 
     | 
    
         
            +
                      rel_time: Integer|Float,
         
     | 
| 
      
 13 
     | 
    
         
            +
                      rel_key: String,
         
     | 
| 
      
 14 
     | 
    
         
            +
                      rel_queue: String,
         
     | 
| 
      
 15 
     | 
    
         
            +
                      queue_res: Symbol,
         
     | 
| 
      
 16 
     | 
    
         
            +
                      lock_res: Symbol
         
     | 
| 
      
 17 
     | 
    
         
            +
                    }
         
     | 
| 
      
 18 
     | 
    
         
            +
                  }
         
     | 
| 
      
 19 
     | 
    
         
            +
                  def self.release_lock: (
         
     | 
| 
      
 20 
     | 
    
         
            +
                    RC::client redis,
         
     | 
| 
      
 21 
     | 
    
         
            +
                    String lock_name,
         
     | 
| 
      
 22 
     | 
    
         
            +
                    RQL::instrObj instrumenter,
         
     | 
| 
      
 23 
     | 
    
         
            +
                    RQL::loggerObj logger,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    bool log_sampling_enabled,
         
     | 
| 
      
 25 
     | 
    
         
            +
                    Integer log_samplingPercent,
         
     | 
| 
      
 26 
     | 
    
         
            +
                    RQL::Logging::samplerObj log_sampler,
         
     | 
| 
      
 27 
     | 
    
         
            +
                    bool log_sample_this,
         
     | 
| 
      
 28 
     | 
    
         
            +
                    bool instr_sampling_enabled,
         
     | 
| 
      
 29 
     | 
    
         
            +
                    Integer instr_sampling_percent,
         
     | 
| 
      
 30 
     | 
    
         
            +
                    RQL::Instrument::samplerObj instr_sampler,
         
     | 
| 
      
 31 
     | 
    
         
            +
                    bool instr_sample_this
         
     | 
| 
      
 32 
     | 
    
         
            +
                  ) -> releaseResult
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                  type fullReleaseResult = { ok: bool, result: { queue: Symbol, lock: Symbol } }
         
     | 
| 
      
 35 
     | 
    
         
            +
                  private def self.fully_release_lock: (RC::client redis, String lock_key, String lock_key_queue) -> fullReleaseResult
         
     | 
| 
      
 36 
     | 
    
         
            +
                end
         
     | 
| 
      
 37 
     | 
    
         
            +
              end
         
     | 
| 
      
 38 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,46 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisQueuedLocks as RQL
         
     | 
| 
      
 2 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 5 
     | 
    
         
            +
              module Acquirer
         
     | 
| 
      
 6 
     | 
    
         
            +
                module ReleaseLocksOf
         
     | 
| 
      
 7 
     | 
    
         
            +
                  extend RQL::Utilities
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  type releaseResult = {
         
     | 
| 
      
 10 
     | 
    
         
            +
                    ok: bool,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    result: {
         
     | 
| 
      
 12 
     | 
    
         
            +
                      rel_key_cnt: Integer,
         
     | 
| 
      
 13 
     | 
    
         
            +
                      tch_queue_cnt: Integer,
         
     | 
| 
      
 14 
     | 
    
         
            +
                      rel_time: Integer|Float
         
     | 
| 
      
 15 
     | 
    
         
            +
                    }
         
     | 
| 
      
 16 
     | 
    
         
            +
                  }
         
     | 
| 
      
 17 
     | 
    
         
            +
                  def self.release_locks_of: (
         
     | 
| 
      
 18 
     | 
    
         
            +
                    String host_id,
         
     | 
| 
      
 19 
     | 
    
         
            +
                    String acquirer_id,
         
     | 
| 
      
 20 
     | 
    
         
            +
                    RC::client redis,
         
     | 
| 
      
 21 
     | 
    
         
            +
                    Integer lock_scan_size,
         
     | 
| 
      
 22 
     | 
    
         
            +
                    Integer queue_scan_size,
         
     | 
| 
      
 23 
     | 
    
         
            +
                    RQL::loggerObj logger,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    RQL::instrObj instrumenter,
         
     | 
| 
      
 25 
     | 
    
         
            +
                    untyped instrument,
         
     | 
| 
      
 26 
     | 
    
         
            +
                    bool log_sampling_enabled,
         
     | 
| 
      
 27 
     | 
    
         
            +
                    Integer log_sampling_percent,
         
     | 
| 
      
 28 
     | 
    
         
            +
                    RQL::Logging::samplerObj log_sampler,
         
     | 
| 
      
 29 
     | 
    
         
            +
                    bool log_sample_this,
         
     | 
| 
      
 30 
     | 
    
         
            +
                    bool instr_sampling_enabled,
         
     | 
| 
      
 31 
     | 
    
         
            +
                    Integer instr_sampling_percent,
         
     | 
| 
      
 32 
     | 
    
         
            +
                    RQL::Instrument::samplerObj instr_sampler,
         
     | 
| 
      
 33 
     | 
    
         
            +
                    bool instr_sample_this
         
     | 
| 
      
 34 
     | 
    
         
            +
                  ) -> releaseResult
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                  type fullyReleaseAllLocksResult = { ok: bool, result: { rel_key_cnt: Integer, tch_queue_cnt: Integer } }
         
     | 
| 
      
 37 
     | 
    
         
            +
                  private def self.fully_release_locks_of: (
         
     | 
| 
      
 38 
     | 
    
         
            +
                    String refused_host_id,
         
     | 
| 
      
 39 
     | 
    
         
            +
                    String refused_acquirer_id,
         
     | 
| 
      
 40 
     | 
    
         
            +
                    RC::client redis,
         
     | 
| 
      
 41 
     | 
    
         
            +
                    Integer locks_scan_size,
         
     | 
| 
      
 42 
     | 
    
         
            +
                    Integer queue_scan_size
         
     | 
| 
      
 43 
     | 
    
         
            +
                  ) -> fullyReleaseAllLocksResult
         
     | 
| 
      
 44 
     | 
    
         
            +
                end
         
     | 
| 
      
 45 
     | 
    
         
            +
              end
         
     | 
| 
      
 46 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,235 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisQueuedLocks as RQL
         
     | 
| 
      
 2 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 5 
     | 
    
         
            +
              class Client
         
     | 
| 
      
 6 
     | 
    
         
            +
                @config: RQL::Config
         
     | 
| 
      
 7 
     | 
    
         
            +
                @redis_client: RC::client
         
     | 
| 
      
 8 
     | 
    
         
            +
                @uniq_identity: String
         
     | 
| 
      
 9 
     | 
    
         
            +
                @swarm: RQL::Swarm
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                attr_reader config: RQL::Config
         
     | 
| 
      
 12 
     | 
    
         
            +
                attr_reader redis_client: RC::client
         
     | 
| 
      
 13 
     | 
    
         
            +
                attr_accessor uniq_identity: String
         
     | 
| 
      
 14 
     | 
    
         
            +
                attr_reader swarm: RQL::Swarm
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                def initialize: (RC::client redis_client) ?{ (RQL::Config) -> void } -> void
         
     | 
| 
      
 17 
     | 
    
         
            +
                def configure: () ?{ (RQL::Config) -> void } -> void
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                def swarmize!: () -> RQL::Swarm::swarmizeResult
         
     | 
| 
      
 20 
     | 
    
         
            +
                def deswarmize!: () -> RQL::Swarm::deswarmizeResult
         
     | 
| 
      
 21 
     | 
    
         
            +
                def swarm_info: (?zombie_ttl: Integer) -> RQL::Swarm::Acquirers::acquirersList
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                def swarm_status: () -> RQL::Swarm::swarmStatus
         
     | 
| 
      
 24 
     | 
    
         
            +
                alias swarm_state swarm_status
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
                def probe_hosts: () -> RQL::Swarm::ProbeHosts::livingHosts
         
     | 
| 
      
 27 
     | 
    
         
            +
                def flush_zombies: (?zombie_ttl: Integer, ?lock_scan_size: Integer, ?queue_scan_size: Integer) -> RQL::Swarm::FlushZombies::flushedZombies
         
     | 
| 
      
 28 
     | 
    
         
            +
                def zombie_locks: (?zombie_ttl: Integer, ?lock_scan_size: Integer) -> RQL::Swarm::ZombieInfo::zombieLocks
         
     | 
| 
      
 29 
     | 
    
         
            +
                def zombie_acquirers: (?zombie_ttl: Integer, ?lock_scan_size: Integer) -> RQL::Swarm::ZombieInfo::zombieAcquirers
         
     | 
| 
      
 30 
     | 
    
         
            +
                def zombie_hosts: (?zombie_ttl: Integer) -> RQL::Swarm::ZombieInfo::zombieHosts
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                def zombies_info: (?zombie_ttl: Integer, ?lock_scan_size: Integer) -> RQL::Swarm::ZombieInfo::zombieInfo
         
     | 
| 
      
 33 
     | 
    
         
            +
                alias zombies zombies_info
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                def lock: (
         
     | 
| 
      
 36 
     | 
    
         
            +
                  String lock_name,
         
     | 
| 
      
 37 
     | 
    
         
            +
                  ?ttl: Integer,
         
     | 
| 
      
 38 
     | 
    
         
            +
                  ?queue_ttl: Integer,
         
     | 
| 
      
 39 
     | 
    
         
            +
                  ?timeout: Integer?,
         
     | 
| 
      
 40 
     | 
    
         
            +
                  ?timed: bool,
         
     | 
| 
      
 41 
     | 
    
         
            +
                  ?retry_count: Integer?,
         
     | 
| 
      
 42 
     | 
    
         
            +
                  ?retry_delay: Integer,
         
     | 
| 
      
 43 
     | 
    
         
            +
                  ?retry_jitter: Integer,
         
     | 
| 
      
 44 
     | 
    
         
            +
                  ?raise_errors: bool,
         
     | 
| 
      
 45 
     | 
    
         
            +
                  ?fail_fast: bool,
         
     | 
| 
      
 46 
     | 
    
         
            +
                  ?conflict_strategy: Symbol,
         
     | 
| 
      
 47 
     | 
    
         
            +
                  ?read_write_mode: Symbol,
         
     | 
| 
      
 48 
     | 
    
         
            +
                  ?access_strategy: Symbol,
         
     | 
| 
      
 49 
     | 
    
         
            +
                  ?identity: String,
         
     | 
| 
      
 50 
     | 
    
         
            +
                  ?meta: Hash[String|Symbol,untyped]?,
         
     | 
| 
      
 51 
     | 
    
         
            +
                  ?detailed_acq_timeout_error: bool,
         
     | 
| 
      
 52 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 53 
     | 
    
         
            +
                  ?log_lock_try: bool,
         
     | 
| 
      
 54 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 55 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 56 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 57 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 58 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 59 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 60 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 61 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 62 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 63 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 64 
     | 
    
         
            +
                ) ?{ (?) -> untyped } -> RQL::Acquirer::AcquireLock::acquireResult
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
                def lock!: (
         
     | 
| 
      
 67 
     | 
    
         
            +
                  String lock_name,
         
     | 
| 
      
 68 
     | 
    
         
            +
                  ?ttl: Integer,
         
     | 
| 
      
 69 
     | 
    
         
            +
                  ?queue_ttl: Integer,
         
     | 
| 
      
 70 
     | 
    
         
            +
                  ?timeout: Integer?,
         
     | 
| 
      
 71 
     | 
    
         
            +
                  ?timed: bool,
         
     | 
| 
      
 72 
     | 
    
         
            +
                  ?retry_count: Integer?,
         
     | 
| 
      
 73 
     | 
    
         
            +
                  ?retry_delay: Integer,
         
     | 
| 
      
 74 
     | 
    
         
            +
                  ?retry_jitter: Integer,
         
     | 
| 
      
 75 
     | 
    
         
            +
                  ?fail_fast: bool,
         
     | 
| 
      
 76 
     | 
    
         
            +
                  ?conflict_strategy: Symbol,
         
     | 
| 
      
 77 
     | 
    
         
            +
                  ?read_write_mode: Symbol,
         
     | 
| 
      
 78 
     | 
    
         
            +
                  ?access_strategy: Symbol,
         
     | 
| 
      
 79 
     | 
    
         
            +
                  ?identity: String,
         
     | 
| 
      
 80 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 81 
     | 
    
         
            +
                  ?meta: Hash[String|Symbol,untyped]?,
         
     | 
| 
      
 82 
     | 
    
         
            +
                  ?detailed_acq_timeout_error: bool,
         
     | 
| 
      
 83 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 84 
     | 
    
         
            +
                  ?log_lock_try: bool,
         
     | 
| 
      
 85 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 86 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 87 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 88 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 89 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 90 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 91 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 92 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 93 
     | 
    
         
            +
                  ?instr_sample_this: bool,
         
     | 
| 
      
 94 
     | 
    
         
            +
                ) ?{ (?) -> untyped } -> RQL::Acquirer::AcquireLock::acquireResult
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
                def unlock: (
         
     | 
| 
      
 97 
     | 
    
         
            +
                  String lock_name,
         
     | 
| 
      
 98 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 99 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 100 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 101 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 102 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 103 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 104 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 105 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 106 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 107 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 108 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 109 
     | 
    
         
            +
                ) -> RQL::Acquirer::ReleaseLock::releaseResult
         
     | 
| 
      
 110 
     | 
    
         
            +
                alias release_lock unlock
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                def locked?: (String lock_name) -> bool
         
     | 
| 
      
 113 
     | 
    
         
            +
                def queued?: (String lock_name) -> bool
         
     | 
| 
      
 114 
     | 
    
         
            +
                def lock_info: (String lock_name) -> RQL::Acquirer::LockInfo::lockInfo?
         
     | 
| 
      
 115 
     | 
    
         
            +
                def queue_info: (String lock_name) -> RQL::Acquirer::QueueInfo::queueInfo?
         
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
      
 117 
     | 
    
         
            +
                def current_acquirer_id: (
         
     | 
| 
      
 118 
     | 
    
         
            +
                  ?process_id: Integer|String,
         
     | 
| 
      
 119 
     | 
    
         
            +
                  ?thread_id: Integer|String,
         
     | 
| 
      
 120 
     | 
    
         
            +
                  ?fiber_id: Integer|String,
         
     | 
| 
      
 121 
     | 
    
         
            +
                  ?ractor_id: Integer|String,
         
     | 
| 
      
 122 
     | 
    
         
            +
                  ?identity: String
         
     | 
| 
      
 123 
     | 
    
         
            +
                ) -> String
         
     | 
| 
      
 124 
     | 
    
         
            +
                alias ccurrent_acq_id current_acquirer_id
         
     | 
| 
      
 125 
     | 
    
         
            +
                alias acq_id current_acquirer_id
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
                def current_host_id: (
         
     | 
| 
      
 128 
     | 
    
         
            +
                  ?process_id: Integer|String,
         
     | 
| 
      
 129 
     | 
    
         
            +
                  ?thread_id: Integer|String,
         
     | 
| 
      
 130 
     | 
    
         
            +
                  ?ractor_id: Integer|String,
         
     | 
| 
      
 131 
     | 
    
         
            +
                  ?identity: String
         
     | 
| 
      
 132 
     | 
    
         
            +
                ) -> String
         
     | 
| 
      
 133 
     | 
    
         
            +
                alias current_hst_id current_host_id
         
     | 
| 
      
 134 
     | 
    
         
            +
                alias hst_id current_host_id
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                def possible_host_ids: (?String identity) -> Array[String]
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                def extend_lock_ttl: (
         
     | 
| 
      
 139 
     | 
    
         
            +
                  String lock_name,
         
     | 
| 
      
 140 
     | 
    
         
            +
                  Integer milliseconds,
         
     | 
| 
      
 141 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 142 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 143 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 144 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 145 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 146 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 147 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 148 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 149 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 150 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 151 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 152 
     | 
    
         
            +
                ) -> RQL::Acquirer::ExtendLockTTL::extendResult
         
     | 
| 
      
 153 
     | 
    
         
            +
             
     | 
| 
      
 154 
     | 
    
         
            +
                def clear_locks: (
         
     | 
| 
      
 155 
     | 
    
         
            +
                  ?batch_size: Integer,
         
     | 
| 
      
 156 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 157 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 158 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 159 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 160 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 161 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 162 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 163 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 164 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 165 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 166 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 167 
     | 
    
         
            +
                ) -> RQL::Acquirer::ReleaseAllLocks::releaseResult
         
     | 
| 
      
 168 
     | 
    
         
            +
                alias release_locks clear_locks
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
      
 170 
     | 
    
         
            +
                def clear_locks_of: (
         
     | 
| 
      
 171 
     | 
    
         
            +
                  host_id: String,
         
     | 
| 
      
 172 
     | 
    
         
            +
                  acquirer_id: String,
         
     | 
| 
      
 173 
     | 
    
         
            +
                  ?lock_scan_size: Integer,
         
     | 
| 
      
 174 
     | 
    
         
            +
                  ?queue_scan_size: Integer,
         
     | 
| 
      
 175 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 176 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 177 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 178 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 179 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 180 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 181 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 182 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 183 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 184 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 185 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 186 
     | 
    
         
            +
                ) -> RQL::Acquirer::ReleaseLocksOf::releaseResult
         
     | 
| 
      
 187 
     | 
    
         
            +
                alias release_locks_of clear_locks_of
         
     | 
| 
      
 188 
     | 
    
         
            +
             
     | 
| 
      
 189 
     | 
    
         
            +
                def clear_current_locks: (
         
     | 
| 
      
 190 
     | 
    
         
            +
                  ?lock_scan_size: Integer,
         
     | 
| 
      
 191 
     | 
    
         
            +
                  ?queue_scan_size: Integer,
         
     | 
| 
      
 192 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 193 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 194 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 195 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 196 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 197 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 198 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 199 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 200 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 201 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 202 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 203 
     | 
    
         
            +
                ) -> RQL::Acquirer::ReleaseLocksOf::releaseResult
         
     | 
| 
      
 204 
     | 
    
         
            +
                alias release_current_locks clear_current_locks
         
     | 
| 
      
 205 
     | 
    
         
            +
             
     | 
| 
      
 206 
     | 
    
         
            +
                def locks: (?scan_size: Integer, ?with_info: bool) -> RQL::Acquirer::Locks::locks
         
     | 
| 
      
 207 
     | 
    
         
            +
                         | (?scan_size: Integer, ?with_info: true) -> RQL::Acquirer::Locks::locksInfo
         
     | 
| 
      
 208 
     | 
    
         
            +
                         | (?scan_size: Integer, ?with_info: false) -> RQL::Acquirer::Locks::lockList
         
     | 
| 
      
 209 
     | 
    
         
            +
             
     | 
| 
      
 210 
     | 
    
         
            +
                def locks_info: (?scan_size: Integer) -> RQL::Acquirer::Locks::locksInfo
         
     | 
| 
      
 211 
     | 
    
         
            +
             
     | 
| 
      
 212 
     | 
    
         
            +
                def queues: (?scan_size: Integer, ?with_info: bool) -> RQL::Acquirer::Queues::queues
         
     | 
| 
      
 213 
     | 
    
         
            +
                          | (?scan_size: Integer, ?with_info: true) -> RQL::Acquirer::Queues::queuesInfo
         
     | 
| 
      
 214 
     | 
    
         
            +
                          | (?scan_size: Integer, ?with_info: false) -> RQL::Acquirer::Queues::queueList
         
     | 
| 
      
 215 
     | 
    
         
            +
             
     | 
| 
      
 216 
     | 
    
         
            +
                def queues_info: (?scan_size: Integer) -> RQL::Acquirer::Queues::queues
         
     | 
| 
      
 217 
     | 
    
         
            +
                def keys: (?scan_size: Integer) -> RQL::Acquirer::Keys::keyList
         
     | 
| 
      
 218 
     | 
    
         
            +
             
     | 
| 
      
 219 
     | 
    
         
            +
                def clear_dead_requests: (
         
     | 
| 
      
 220 
     | 
    
         
            +
                  ?dead_ttl: Integer,
         
     | 
| 
      
 221 
     | 
    
         
            +
                  ?scan_size: Integer,
         
     | 
| 
      
 222 
     | 
    
         
            +
                  ?logger: RQL::loggerObj,
         
     | 
| 
      
 223 
     | 
    
         
            +
                  ?instrumenter: RQL::instrObj,
         
     | 
| 
      
 224 
     | 
    
         
            +
                  ?instrument: untyped?,
         
     | 
| 
      
 225 
     | 
    
         
            +
                  ?log_sampling_enabled: bool,
         
     | 
| 
      
 226 
     | 
    
         
            +
                  ?log_sampling_percent: Integer,
         
     | 
| 
      
 227 
     | 
    
         
            +
                  ?log_sampler: RQL::Logging::samplerObj,
         
     | 
| 
      
 228 
     | 
    
         
            +
                  ?log_sample_this: bool,
         
     | 
| 
      
 229 
     | 
    
         
            +
                  ?instr_sampling_enabled: bool,
         
     | 
| 
      
 230 
     | 
    
         
            +
                  ?instr_sampling_percent: Integer,
         
     | 
| 
      
 231 
     | 
    
         
            +
                  ?instr_sampler: RQL::Instrument::samplerObj,
         
     | 
| 
      
 232 
     | 
    
         
            +
                  ?instr_sample_this: bool
         
     | 
| 
      
 233 
     | 
    
         
            +
                ) -> RQL::Acquirer::ClearDeadRequests::clearResult
         
     | 
| 
      
 234 
     | 
    
         
            +
              end
         
     | 
| 
      
 235 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,26 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Config
         
     | 
| 
      
 3 
     | 
    
         
            +
                module DSL
         
     | 
| 
      
 4 
     | 
    
         
            +
                  type configSetters = Hash[String,Proc]
         
     | 
| 
      
 5 
     | 
    
         
            +
                  type configValidators = Hash[String,Proc]
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                  module ClassMethods
         
     | 
| 
      
 8 
     | 
    
         
            +
                    @config_setters: configSetters
         
     | 
| 
      
 9 
     | 
    
         
            +
                    @config_validators: configValidators
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                    def config_setters: () -> configSetters
         
     | 
| 
      
 12 
     | 
    
         
            +
                    def config_validators: () -> configValidators
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                    def validate: (String config_key) { (String) -> bool } -> void
         
     | 
| 
      
 15 
     | 
    
         
            +
                    def setting: (String config_key, untyped config_value) -> void
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                  module InstanceMethods
         
     | 
| 
      
 19 
     | 
    
         
            +
                    def config_setters: () -> configSetters
         
     | 
| 
      
 20 
     | 
    
         
            +
                    def config_validators: () -> configValidators
         
     | 
| 
      
 21 
     | 
    
         
            +
                  end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                  def self.included: (Class child_klass) -> void
         
     | 
| 
      
 24 
     | 
    
         
            +
                end
         
     | 
| 
      
 25 
     | 
    
         
            +
              end
         
     | 
| 
      
 26 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Config
         
     | 
| 
      
 3 
     | 
    
         
            +
                include RedisQueuedLocks::Config::DSL
         
     | 
| 
      
 4 
     | 
    
         
            +
                include RedisQueuedLocks::Config::DSL::InstanceMethods
         
     | 
| 
      
 5 
     | 
    
         
            +
                extend RedisQueuedLocks::Config::DSL::ClassMethods
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                type configState = Hash[String,untyped]
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                @config_state: configState
         
     | 
| 
      
 10 
     | 
    
         
            +
                attr_reader config_state: configState
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                def initialize: () ?{ (RedisQueuedLocks::Config) -> void } -> void
         
     | 
| 
      
 13 
     | 
    
         
            +
                def configure: () ?{ (RedisQueuedLocks::Config) -> void } -> void
         
     | 
| 
      
 14 
     | 
    
         
            +
                def []: (String config_key) -> untyped
         
     | 
| 
      
 15 
     | 
    
         
            +
                def []=: (String config_key, untyped config_value) -> void
         
     | 
| 
      
 16 
     | 
    
         
            +
                def slice: (String config_key_pattern) -> configState
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                private
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                def prevent_key__non_existent: (String config_key) -> void
         
     | 
| 
      
 21 
     | 
    
         
            +
                def prevent_key__invalid_type: (String config_key, untyped config_value) -> void
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Debugger
         
     | 
| 
      
 3 
     | 
    
         
            +
                DEBUG_ENABLED_METHOD: String
         
     | 
| 
      
 4 
     | 
    
         
            +
                DEBUG_DISABLED_MEHTOD: String
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                self.@enabled: bool
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                def self.enable!: () -> void
         
     | 
| 
      
 9 
     | 
    
         
            +
                def self.disable!: () -> void
         
     | 
| 
      
 10 
     | 
    
         
            +
                def self.enabled?: () -> bool
         
     | 
| 
      
 11 
     | 
    
         
            +
                def self.debug: (String message) -> void
         
     | 
| 
      
 12 
     | 
    
         
            +
              end
         
     | 
| 
      
 13 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,43 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 2 
     | 
    
         
            +
              class Error < ::StandardError
         
     | 
| 
      
 3 
     | 
    
         
            +
              end
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              class ArgumentError < ::ArgumentError
         
     | 
| 
      
 6 
     | 
    
         
            +
              end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
              class LockAlreadyObtainedError < Error
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              class LockAcquirementIntermediateTimeoutError < ::Timeout::Error
         
     | 
| 
      
 12 
     | 
    
         
            +
              end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              class LockAcquirementTimeoutError < Error
         
     | 
| 
      
 15 
     | 
    
         
            +
              end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
              class LockAcquirementRetryLimitError < Error
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
              class TimedLockIntermediateTimeoutError < ::Timeout::Error
         
     | 
| 
      
 21 
     | 
    
         
            +
              end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
              class TimedLockTimeoutError < Error
         
     | 
| 
      
 24 
     | 
    
         
            +
              end
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
              class ConflictLockObtainError < Error
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
              class SwarmError < Error
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              class SwarmArgumentError < ArgumentError
         
     | 
| 
      
 33 
     | 
    
         
            +
              end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              class ConfigError < Error
         
     | 
| 
      
 36 
     | 
    
         
            +
              end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
              class ConfigNotFoundError < ConfigError
         
     | 
| 
      
 39 
     | 
    
         
            +
              end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              class ConfigValidationError < ConfigError
         
     | 
| 
      
 42 
     | 
    
         
            +
              end
         
     | 
| 
      
 43 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisQueuedLocks as RQL
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Instrument
         
     | 
| 
      
 5 
     | 
    
         
            +
                interface _Sampler
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def sampling_happened?: (Integer sampling_percent) -> bool
         
     | 
| 
      
 7 
     | 
    
         
            +
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                type samplerObj = Object & _Sampler
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def self.should_instrument?: (bool instr_sampling_enabled, bool instr_sample_this, Integer instr_sampling_percent, samplerObj instr_sampler) -> bool
         
     | 
| 
      
 12 
     | 
    
         
            +
                def self.valid_sampler?: (untyped sampler) -> bool
         
     | 
| 
      
 13 
     | 
    
         
            +
                def self.valid_interface?: (untyped instrumenter) -> bool
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Logging
         
     | 
| 
      
 3 
     | 
    
         
            +
                module VoidLogger
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def self.warn: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 5 
     | 
    
         
            +
                  def self.unknown: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def self.log: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 7 
     | 
    
         
            +
                  def self.info: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 8 
     | 
    
         
            +
                  def self.error: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 9 
     | 
    
         
            +
                  def self.fatal: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 10 
     | 
    
         
            +
                  def self.debug: (?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 11 
     | 
    
         
            +
                  def self.add: (?untyped? severity, ?untyped? message, ?untyped? progname) { (?) -> untyped } -> nil
         
     | 
| 
      
 12 
     | 
    
         
            +
                  def self.<<: (untyped message) -> nil
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisQueuedLocks as RQL
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Logging
         
     | 
| 
      
 5 
     | 
    
         
            +
                interface _Sampler
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def sampling_happened?: (Integer sampling_percent) -> bool
         
     | 
| 
      
 7 
     | 
    
         
            +
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                type samplerObj = Object & _Sampler
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def self.should_log?: (bool log_sampling_enabled, bool log_sample_this, Integer log_sampling_percent, samplerObj log_sampler) -> bool
         
     | 
| 
      
 12 
     | 
    
         
            +
                def self.valid_sampler?: (untyped sampler) -> bool
         
     | 
| 
      
 13 
     | 
    
         
            +
                def self.valid_interface?: (untyped logger) -> bool
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,42 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Resource
         
     | 
| 
      
 3 
     | 
    
         
            +
                KEY_PATTERN: String
         
     | 
| 
      
 4 
     | 
    
         
            +
                LOCK_PATTERN: String
         
     | 
| 
      
 5 
     | 
    
         
            +
                LOCK_QUEUE_PATTERN: String
         
     | 
| 
      
 6 
     | 
    
         
            +
                READ_LOCK_QUEUE_PATTERN: String
         
     | 
| 
      
 7 
     | 
    
         
            +
                WRITE_LOCK_QUEUE_PATTERN: String
         
     | 
| 
      
 8 
     | 
    
         
            +
                SWARM_KEY: String
         
     | 
| 
      
 9 
     | 
    
         
            +
                REDIS_TIMESHIFT_ERROR: Integer
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                def self.calc_uniq_identity: () -> String
         
     | 
| 
      
 12 
     | 
    
         
            +
                def self.acquirer_identifier: (
         
     | 
| 
      
 13 
     | 
    
         
            +
                  Integer|String process_id,
         
     | 
| 
      
 14 
     | 
    
         
            +
                  Integer|String thread_id,
         
     | 
| 
      
 15 
     | 
    
         
            +
                  Integer|String fiber_id,
         
     | 
| 
      
 16 
     | 
    
         
            +
                  Integer|String ractor_id,
         
     | 
| 
      
 17 
     | 
    
         
            +
                  String identity
         
     | 
| 
      
 18 
     | 
    
         
            +
                ) -> String
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                def self.host_identifier: (
         
     | 
| 
      
 21 
     | 
    
         
            +
                  Integer|String process_id,
         
     | 
| 
      
 22 
     | 
    
         
            +
                  Integer|String thread_id,
         
     | 
| 
      
 23 
     | 
    
         
            +
                  Integer|string ractor_id,
         
     | 
| 
      
 24 
     | 
    
         
            +
                  String identity
         
     | 
| 
      
 25 
     | 
    
         
            +
                ) -> String
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                def self.prepare_lock_key: (String lock_name) -> String
         
     | 
| 
      
 28 
     | 
    
         
            +
                def self.prepare_lock_queue: (String lock_name) -> String
         
     | 
| 
      
 29 
     | 
    
         
            +
                def self.prepare_read_lock_queue: (String lock_name) -> String
         
     | 
| 
      
 30 
     | 
    
         
            +
                def self.prepare_write_lock_queue: (String lock_name) -> String
         
     | 
| 
      
 31 
     | 
    
         
            +
                def self.calc_initial_acquirer_position: () -> Float
         
     | 
| 
      
 32 
     | 
    
         
            +
                def self.acquirer_dead_score: (Integer|Float queue_ttl) -> Float
         
     | 
| 
      
 33 
     | 
    
         
            +
                def self.calc_zombie_score: (Float zombie_ttl) -> Float
         
     | 
| 
      
 34 
     | 
    
         
            +
                def self.dead_score_reached?: (Float acquirer_position, Integer queue_ttl) -> bool
         
     | 
| 
      
 35 
     | 
    
         
            +
                def self.lock_key_from_queue: (String lock_queue) -> String
         
     | 
| 
      
 36 
     | 
    
         
            +
                def self.get_thread_id: () -> Integer
         
     | 
| 
      
 37 
     | 
    
         
            +
                def self.get_fiber_id: () -> Integer
         
     | 
| 
      
 38 
     | 
    
         
            +
                def self.get_ractor_id: () -> Integer
         
     | 
| 
      
 39 
     | 
    
         
            +
                def self.get_process_id: () -> Integer
         
     | 
| 
      
 40 
     | 
    
         
            +
                def self.possible_host_identifiers: (String identity) -> Array[String]
         
     | 
| 
      
 41 
     | 
    
         
            +
              end
         
     | 
| 
      
 42 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Swarm
         
     | 
| 
      
 5 
     | 
    
         
            +
                module Acquirers
         
     | 
| 
      
 6 
     | 
    
         
            +
                  type acquirersList = Hash[String,{ zombie: bool, last_probe_time: Time, last_probe_score: Float }]
         
     | 
| 
      
 7 
     | 
    
         
            +
                  def self.acquirers: (RC::client redis_client, Integer zombie_ttl) -> acquirersList
         
     | 
| 
      
 8 
     | 
    
         
            +
                end
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Swarm
         
     | 
| 
      
 5 
     | 
    
         
            +
                class FlushZombies < SwarmElement::Isolated
         
     | 
| 
      
 6 
     | 
    
         
            +
                  type flushedZombies = { ok: bool, deleted_zombie_hosts: Set[String], deleted_zombie_acquirers: Set[String], deleted_zombie_locks: Set[String] }
         
     | 
| 
      
 7 
     | 
    
         
            +
                  def self.flush_zombies: (RC::client redis_client, Integer zombie_ttl, Integer lock_scan_size, Integer queue_scan_size) -> flushedZombies
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  def enabled?: () -> bool
         
     | 
| 
      
 10 
     | 
    
         
            +
                  def swarm!: () -> void
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
              end
         
     | 
| 
      
 13 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Swarm
         
     | 
| 
      
 5 
     | 
    
         
            +
                class ProbeHosts < SwarmElement::Threaded
         
     | 
| 
      
 6 
     | 
    
         
            +
                  type livingHosts = { ok: bool, result: Hash[String,Float] }
         
     | 
| 
      
 7 
     | 
    
         
            +
                  def self.probe_hosts: (RC::client redis_client, String uniq_identity) -> livingHosts
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  def enabled?: () -> bool
         
     | 
| 
      
 10 
     | 
    
         
            +
                  def spawn_main_loop!: () -> Thread
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
              end
         
     | 
| 
      
 13 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            use RedisClient as RC
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module RedisQueuedLocks
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Swarm
         
     | 
| 
      
 5 
     | 
    
         
            +
                module RedisClientBuilder
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def self.build: (
         
     | 
| 
      
 7 
     | 
    
         
            +
                    ?pooled: bool,
         
     | 
| 
      
 8 
     | 
    
         
            +
                    ?sentinel: bool,
         
     | 
| 
      
 9 
     | 
    
         
            +
                    ?config: Hash[untyped,untyped],
         
     | 
| 
      
 10 
     | 
    
         
            +
                    ?pool_config: Hash[untyped,untyped]
         
     | 
| 
      
 11 
     | 
    
         
            +
                  ) -> RC::client
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  private def self.sentinel_config: (Hash[Symbol,untyped] config) -> RC::SentinelConfig
         
     | 
| 
      
 14 
     | 
    
         
            +
                  private def self.non_sentinel_config: (Hash[Symbol,untyped] config) -> RC::Config
         
     | 
| 
      
 15 
     | 
    
         
            +
                  private def self.pooled_client: (RC::config redis_config, Hash[Symbol,untyped] pool_config) -> RedisClient::Pooled
         
     | 
| 
      
 16 
     | 
    
         
            +
                  private def self.non_pooled_client: (RC::config redis_config) -> RedisClient
         
     | 
| 
      
 17 
     | 
    
         
            +
                end
         
     | 
| 
      
 18 
     | 
    
         
            +
              end
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     |