class Sidekiq::WorkSet

The WorkSet stores the work being done by this Sidekiq cluster. It tracks the process and thread working on each job.

WARNING WARNING WARNING

This is live data that can change every millisecond. If you call size => 5 and then expect each to be called 5 times, you’re going to have a bad time.

works = Sidekiq::WorkSet.new
works.size => 2
works.each do |process_id, thread_id, work|
  # process_id is a unique identifier per Sidekiq process
  # thread_id is a unique identifier per thread
  # work is a `Sidekiq::Work` instance that has the following accessor methods.
  # [work.queue, work.run_at, work.payload]
  # run_at is an epoch Integer.
end