Sha256: 942f61cfec15590b0404890c6b3eda4315bf0c446a4c1d39f984731d1786b554

Contents?: true

Size: 738 Bytes

Versions: 10

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

module SidekiqUniqueJobs
  module OnConflict
    # Abstract conflict strategy class
    #
    # @abstract
    # @author Mikael Henriksson <mikael@zoolutions.se>
    class Strategy
      include SidekiqUniqueJobs::Logging

      # The sidekiq job hash
      # @return [Hash] the Sidekiq job hash
      attr_reader :item

      # @param [Hash] item the Sidekiq job hash
      def initialize(item)
        @item = item
      end

      # Use strategy on conflict
      # @raise [NotImplementedError] needs to be implemented in child class
      def call
        fail NotImplementedError, 'needs to be implemented in child class'
      end

      def replace?
        is_a?(Replace)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.8 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.7 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.6 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.5 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.4 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.3 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.2 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.1 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.0 lib/sidekiq_unique_jobs/on_conflict/strategy.rb
sidekiq-unique-jobs-6.0.0.rc8 lib/sidekiq_unique_jobs/on_conflict/strategy.rb