class Pliny::Sidekiq::Middleware::Client::RequestId

Attributes

args[R]

Public Instance Methods

call(worker_class, msg, queue, redis_pool) { || ... } click to toggle source
# File lib/pliny/sidekiq/middleware/client/request_id.rb, line 4
def call(worker_class, msg, queue, redis_pool)
  @args = msg['args']
  msg['request_ids'] = request_id.split(',') if request_id
  yield
end

Private Instance Methods

request_id() click to toggle source
# File lib/pliny/sidekiq/middleware/client/request_id.rb, line 14
def request_id
  @request_id ||=
    request_id_args || Pliny::RequestStore.store[:request_id]
end
request_id_args() click to toggle source
# File lib/pliny/sidekiq/middleware/client/request_id.rb, line 19
def request_id_args
  return nil if !args.last.is_a?(Hash)
  options = args.last
  options[:request_id] || options['request_id']
end