Class: Rollbar::Delay::Sidekiq
- Inherits:
-
Object
- Object
- Rollbar::Delay::Sidekiq
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/rollbar/delay/sidekiq.rb
Constant Summary collapse
- OPTIONS =
{ 'queue' => 'rollbar', 'class' => ::Delay::Sidekiq }.freeze
Instance Method Summary collapse
- #call(payload) ⇒ Object
-
#initialize(*args) ⇒ Sidekiq
constructor
A new instance of Sidekiq.
- #perform(*args) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Sidekiq
Returns a new instance of Sidekiq.
8 9 10 |
# File 'lib/rollbar/delay/sidekiq.rb', line 8 def initialize(*args) = (opts = args.shift) ? OPTIONS.merge(opts) : OPTIONS end |
Instance Method Details
#call(payload) ⇒ Object
12 13 14 |
# File 'lib/rollbar/delay/sidekiq.rb', line 12 def call(payload) ::Sidekiq::Client.push .merge('args' => [payload]) end |
#perform(*args) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/rollbar/delay/sidekiq.rb', line 18 def perform(*args) begin .process_from_async_handler(*args) rescue # Raise the exception so Sidekiq can track the errored job # and retry it raise end end |