Class: SidekiqUniqueJobs::Lock::UntilAndWhileExecuting
- Inherits:
-
UntilExecuting
- Object
- UntilExecuted
- UntilExecuting
- SidekiqUniqueJobs::Lock::UntilAndWhileExecuting
- Defined in:
- lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb
Instance Method Summary collapse
Methods inherited from UntilExecuted
#after_yield_yield, #initialize, #lock, #max_lock_time, #unique_key, #unlock
Methods included from Unlockable
after_unlock, logger, unlock, unlock_by_arguments, unlock_by_jid, unlock_by_key
Constructor Details
This class inherits a constructor from SidekiqUniqueJobs::Lock::UntilExecuted
Instance Method Details
#execute(callback) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb', line 4 def execute(callback) lock = WhileExecuting.new(item, redis_pool) lock.synchronize do callback.call if unlock(:server) yield end end |