From 53f2323d42c2b5cfb9db06b15dc321786d132518 Mon Sep 17 00:00:00 2001 From: LifeBCE Date: Sat, 11 Oct 2025 11:26:44 -0500 Subject: [PATCH 1/2] Bump redis dependency to 5.4 --- lib/redis_single_file/semaphore.rb | 12 ++++++++++++ lib/redis_single_file/version.rb | 2 +- redis-single-file.gemspec | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/redis_single_file/semaphore.rb b/lib/redis_single_file/semaphore.rb index a08561d..de5f6b1 100644 --- a/lib/redis_single_file/semaphore.rb +++ b/lib/redis_single_file/semaphore.rb @@ -32,6 +32,12 @@ module RedisSingleFile # # synchronized logic defined here... # end # + # @example Support concurrent worker processing + # semaphore = RedisSingleFile::Semaphore.new(name: :concurrent_queue) + # semaphore.synchronize(concurrency: 3) do + # # synchronized logic defined here... + # end + # # @example Use your own redis client instance # redis = Redis.new(...) # semaphore = RedisSingleFile::Semaphore.new(redis:) @@ -61,6 +67,12 @@ class Semaphore # than globally configured. Passing a value for this attribute will # redirect to that port. # + # @note concurrency: + # When a distributed lock needs to allow multiple executions at once, + # concurrency can be used. When this settings is set to more than the + # default value of 1, the queue will allow that many simultaneous slots + # in the distributed queue. + # # @return [self] semaphore instance def initialize( redis: nil, # provide your own redis instance diff --git a/lib/redis_single_file/version.rb b/lib/redis_single_file/version.rb index 36bb7c8..7543aa2 100644 --- a/lib/redis_single_file/version.rb +++ b/lib/redis_single_file/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module RedisSingleFile - VERSION = '0.1.3' + VERSION = '0.1.4' end diff --git a/redis-single-file.gemspec b/redis-single-file.gemspec index 13ad5af..1991fed 100644 --- a/redis-single-file.gemspec +++ b/redis-single-file.gemspec @@ -41,8 +41,8 @@ Gem::Specification.new do |spec| # spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } # Redis Single File Dependencies - spec.add_dependency 'redis', '~> 5.3.0' - spec.add_dependency 'redis-clustering', '~> 5.3.0' + spec.add_dependency 'redis', '~> 5.4' + spec.add_dependency 'redis-clustering', '~> 5.4' # Disable MFA Requirement - github publishing can't support spec.metadata['rubygems_mfa_required'] = 'false' From ce08668c7422061f0eed6eebc0e2f349e017bd4f Mon Sep 17 00:00:00 2001 From: LifeBCE Date: Sat, 11 Oct 2025 11:32:32 -0500 Subject: [PATCH 2/2] Ooops, lock file --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5999998..c553a90 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,9 @@ PATH remote: . specs: - redis-single-file (0.1.3) - redis (~> 5.3.0) - redis-clustering (~> 5.3.0) + redis-single-file (0.1.4) + redis (~> 5.4) + redis-clustering (~> 5.4) GEM remote: https://rubygems.org/ @@ -29,14 +29,14 @@ GEM racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - redis (5.3.0) + redis (5.4.1) redis-client (>= 0.22.0) redis-client (0.23.2) connection_pool redis-cluster-client (0.13.3) redis-client (~> 0.22) - redis-clustering (5.3.0) - redis (= 5.3.0) + redis-clustering (5.4.1) + redis (= 5.4.1) redis-cluster-client (>= 0.10.0) regexp_parser (2.10.0) rspec (3.13.0)