Module: IdempotencyCheck::SidekiqPerformTracker

Defined in:
lib/idempotency_check/sidekiq.rb

Overview

Accumulates every job actually performed (via Sidekiq::Testing.inline! or a real worker process) for the lifetime of the process, by adding a server middleware. Sidekiq has no ActiveSupport::Notifications-style hook of its own, so we install our own.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.performedObject (readonly)

Returns the value of attribute performed.



16
17
18
# File 'lib/idempotency_check/sidekiq.rb', line 16

def performed
  @performed
end

Class Method Details

.record(job_class, args) ⇒ Object



19
20
21
# File 'lib/idempotency_check/sidekiq.rb', line 19

def self.record(job_class, args)
  @performed << [job_class, args]
end

.reset!Object



23
24
25
# File 'lib/idempotency_check/sidekiq.rb', line 23

def self.reset!
  @performed = []
end