Class: Sidekiq::Throttled::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/throttled/message.rb

Instance Method Summary collapse

Constructor Details

#initialize(item) ⇒ Message

Returns a new instance of Message.



6
7
8
# File 'lib/sidekiq/throttled/message.rb', line 6

def initialize(item)
  @item = item.is_a?(Hash) ? item : parse(item)
end

Instance Method Details

#job_argsObject



14
15
16
# File 'lib/sidekiq/throttled/message.rb', line 14

def job_args
  @item.key?("wrapped") ? @item.dig("args", 0, "arguments") : @item["args"]
end

#job_classObject



10
11
12
# File 'lib/sidekiq/throttled/message.rb', line 10

def job_class
  @item.fetch("wrapped") { @item["class"] }
end

#job_idObject



18
19
20
# File 'lib/sidekiq/throttled/message.rb', line 18

def job_id
  @item["jid"]
end