Sha256: ab52dc217b20783f4eba7b1f8f411a49804190afa1a53098e3ee470780f891d5
Contents?: true
Size: 555 Bytes
Versions: 9
Compression:
Stored size: 555 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@zoolutions.se> class UntilExecuted < BaseLock OK ||= 'OK' # Executes in the Sidekiq server process # @yield to the worker class perform method def execute return unless locked? with_cleanup { yield } end end end end
Version data entries
9 entries across 9 versions & 1 rubygems