Sha256: da0a298b4d4f60e42fb44896cf14a0430d871248f9ad85781a8a592293179edb

Contents?: true

Size: 615 Bytes

Versions: 17

Compression:

Stored size: 615 Bytes

Contents

# frozen_string_literal: true

module SidekiqUniqueJobs
  class Lock
    # 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
    #
    # @author Mikael Henriksson <mikael@mhenrixon.com>
    class UntilExecuted < BaseLock
      OK ||= "OK"

      # Executes in the Sidekiq server process
      # @yield to the worker class perform method
      def execute
        lock do
          yield
          unlock_with_callback
          callback_safely
          item[JID]
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-7.0.12 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.11 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.10 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.9 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.8 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.7 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.6 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.5 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.4 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.3 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.2 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.1 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.0 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.0.beta29 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.0.beta28 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.0.beta27 lib/sidekiq_unique_jobs/lock/until_executed.rb
sidekiq-unique-jobs-7.0.0.beta26 lib/sidekiq_unique_jobs/lock/until_executed.rb