Sha256: 0f550dac5303bcb4137597c210fcf7b7103e2b39885be5e074afe740f79cfad3

Contents?: true

Size: 805 Bytes

Versions: 16

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true

# :nocov:

# This class showcase a job that is considered unique disregarding any worker classes.
# Currently it will only be compared to other jobs that are disregarding worker classes.
# If one were to compare the unique keys generated against a job that doesn't have the
# worker class removed it won't work.
#
# The following specs cover this functionality:
#   - https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/lib/sidekiq_unique_jobs/client/middleware_spec.rb
#   - https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/lib/sidekiq_unique_jobs/unique_args_spec.rb
class UniqueAcrossWorkersJob
  include Sidekiq::Worker
  sidekiq_options lock: :until_executed, unique_across_workers: true

  def perform(one, two)
    [one, two]
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.13 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.12 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.11 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.10 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.9 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.8 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.7 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.6 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.5 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.4 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.3 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.2 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.1 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc8 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc7 examples/unique_across_workers_job.rb