Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions lib/redis_single_file/semaphore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/redis_single_file/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RedisSingleFile
VERSION = '0.1.3'
VERSION = '0.1.4'
end
4 changes: 2 additions & 2 deletions redis-single-file.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading