lib/sidekiq/lock.rb in sidekiq-lock-0.3.1 vs lib/sidekiq/lock.rb in sidekiq-lock-0.4.0

- old
+ new

@@ -1,20 +1,30 @@ +require 'sidekiq/lock/container' require 'sidekiq/lock/middleware' require 'sidekiq/lock/redis_lock' require 'sidekiq/lock/version' require 'sidekiq/lock/worker' module Sidekiq + def self.lock_container + @lock_container ||= Lock::Container.new + end + def self.lock_method - @lock_method ||= :lock + @lock_method ||= Lock::METHOD_NAME end + def self.lock_container=(container) + @lock_container = container + end + def self.lock_method=(method) @lock_method = method end module Lock THREAD_KEY = :sidekiq_lock + METHOD_NAME = :lock end end Sidekiq.configure_server do |config| config.server_middleware do |chain|