Class: SidekiqUniqueJobs::Lock::UntilExecuting

Inherits:
UntilExecuted show all
Defined in:
lib/sidekiq_unique_jobs/lock/until_executing.rb

Direct Known Subclasses

UntilAndWhileExecuting

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, &_block) ⇒ Object



4
5
6
7
# File 'lib/sidekiq_unique_jobs/lock/until_executing.rb', line 4

def execute(callback, &_block)
  callback.call if unlock(:server)
  yield
end