Class: SidekiqUniqueJobs::Lock::UntilExpired
- Defined in:
- lib/sidekiq_unique_jobs/lock/until_expired.rb
Overview
Locks jobs until the lock has expired
-
Locks on perform_in or perform_async
-
Unlocks when the expiration is hit
See BaseLock#lock for more information about the client. See #execute for more information about the server
Instance Method Summary collapse
-
#execute { ... } ⇒ Object
Executes in the Sidekiq server process.
-
#unlock ⇒ true
Prevents these locks from being unlocked.
Methods inherited from BaseLock
#delete, #delete!, #initialize, #lock, #locked?
Methods included from SidekiqUniqueJobs::Logging
#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger, #logging_context
Constructor Details
This class inherits a constructor from SidekiqUniqueJobs::Lock::BaseLock
Instance Method Details
#execute { ... } ⇒ Object
Executes in the Sidekiq server process
22 23 24 25 26 27 |
# File 'lib/sidekiq_unique_jobs/lock/until_expired.rb', line 22 def execute return unless locked? yield # this lock does not handle after_unlock since we don't know when that would happen end |
#unlock ⇒ true
Prevents these locks from being unlocked
16 17 18 |
# File 'lib/sidekiq_unique_jobs/lock/until_expired.rb', line 16 def unlock true end |