Sha256: 0f4994361af046b8be37a92484b36af7e6836390f0d77aabd069f0b5e673775c

Contents?: true

Size: 859 Bytes

Versions: 13

Compression:

Stored size: 859 Bytes

Contents

# frozen_string_literal: true

require_relative "on_conflict/strategy"
require_relative "on_conflict/null_strategy"
require_relative "on_conflict/log"
require_relative "on_conflict/raise"
require_relative "on_conflict/reject"
require_relative "on_conflict/replace"
require_relative "on_conflict/reschedule"

module SidekiqUniqueJobs
  #
  # Provides lock conflict resolutions
  #
  # @author Mikael Henriksson <mikael@zoolutions.se>
  #
  module OnConflict
    STRATEGIES = {
      log: OnConflict::Log,
      raise: OnConflict::Raise,
      reject: OnConflict::Reject,
      replace: OnConflict::Replace,
      reschedule: OnConflict::Reschedule,
    }.freeze

    # returns OnConflict::NullStrategy when no other could be found
    def self.find_strategy(strategy)
      STRATEGIES.fetch(strategy.to_s.to_sym) { OnConflict::NullStrategy }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.25 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.24 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.23 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.22 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.21 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.20 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.16 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.19 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.13 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.12 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.11 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.10 lib/sidekiq_unique_jobs/on_conflict.rb
sidekiq-unique-jobs-6.0.9 lib/sidekiq_unique_jobs/on_conflict.rb