class Labkit::Middleware::Sidekiq::Context::Client
This middleware for Sidekiq-client wraps scheduling jobs in a context The context will also be added to the sidekiq job in redis so it can be reinstantiated by Sidekiq-server when running the job.
Public Instance Methods
call(_worker_class, job, _queue, _redis_pool) { || ... }
click to toggle source
# File lib/labkit/middleware/sidekiq/context/client.rb, line 11 def call(_worker_class, job, _queue, _redis_pool) Labkit::Context.with_context do |context| job.merge!(context.to_h) yield end end