Sha256: 5755e5c200d459d757bca09d4ab1617c2edf35706a454cd87b0d6b81c25fe4b6

Contents?: true

Size: 807 Bytes

Versions: 6

Compression:

Stored size: 807 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 unique: :until_executed, unique_across_workers: true

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.0.rc6 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc5 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc4 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc3 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc2 examples/unique_across_workers_job.rb
sidekiq-unique-jobs-6.0.0.rc1 examples/unique_across_workers_job.rb