Class: SidekiqUniqueJobs::Lock::UntilExecuted
- Defined in:
- lib/sidekiq_unique_jobs/lock/until_executed.rb
Overview
Locks jobs until the server is done executing the job
-
Locks on perform_in or perform_async
-
Unlocks after yielding to the worker’s perform method
Direct Known Subclasses
Instance Method Summary collapse
-
#execute { ... } ⇒ Object
Executes in the Sidekiq server process.
Methods inherited from BaseLock
#delete, #delete!, #initialize, #lock, #locked?, #locksmith, #unlock, validate_options
Methods included from SidekiqUniqueJobs::Logging
included, #log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger, #logging_context, #with_configured_loggers_context, #with_logging_context
Constructor Details
This class inherits a constructor from SidekiqUniqueJobs::Lock::BaseLock
Instance Method Details
#execute { ... } ⇒ Object
Executes in the Sidekiq server process
15 16 17 18 19 20 21 22 |
# File 'lib/sidekiq_unique_jobs/lock/until_executed.rb', line 15 def execute lock do yield unlock_with_callback callback_safely item[JID] end end |