Class: Sidekiq::Status::ClientMiddleware

Inherits:
Object
  • Object
show all
Includes:
Storage
Defined in:
lib/sidekiq-status/client_middleware.rb

Overview

Should be in the client middleware chain

Constant Summary

Constants included from Storage

Storage::BATCH_LIMIT, Storage::RESERVED_FIELDS

Instance Method Summary collapse

Instance Method Details

#call(worker_class, msg, queue) ⇒ Object

Uses msg id and puts :queued status in the job’s Redis hash

Parameters:

  • worker_class (Class)

    if includes Sidekiq::Status::Worker, the job gets processed with the plugin

  • msg (Array)

    job arguments

  • queue (String)

    the queue’s name



9
10
11
12
# File 'lib/sidekiq-status/client_middleware.rb', line 9

def call(worker_class, msg, queue)
  store_status msg['jid'], :queued
  yield
end