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, redis_pool = nil) ⇒ 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

  • redis_pool (ConnectionPool) (defaults to: nil)

    optional redis connection pool



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

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