Sha256: 6e928e4ba82a1d66821cb7bbbb4a445a3e1e963ed6ee952aee57b7711e60accf
Contents?: true
Size: 874 Bytes
Versions: 9
Compression:
Stored size: 874 Bytes
Contents
# frozen_string_literal: true module SidekiqUniqueJobs module Server # The unique sidekiq middleware for the server processor # # @author Mikael Henriksson <mikael@zoolutions.se> class Middleware include OptionsWithFallback # Runs the server middleware # Used from Sidekiq::Processor#process # @param [Sidekiq::Worker] worker_class # @param [Hash] item a sidekiq job hash # @param [String] queue name of the queue # @yield when uniqueness is disabled # @yield when the lock class executes successfully def call(worker_class, item, queue) @worker_class = worker_class @item = item @queue = queue return yield if unique_disabled? lock.execute do yield end end protected attr_reader :item end end end
Version data entries
9 entries across 9 versions & 1 rubygems