Class: Sidekiq::ReliableJob::ClientMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/reliable_job/client_middleware.rb

Overview

Intercepts job pushes and stages them to the Outbox instead of Redis.

Instance Method Summary collapse

Instance Method Details

#call(_job_class, job, _queue, _redis_pool) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/sidekiq/reliable_job/client_middleware.rb', line 7

def call(_job_class, job, _queue, _redis_pool)
  return yield if skip_staging?(job)

  job["reliable_job"] = true
  Client.push(job)

  yield if testing_enabled?
end