Sha256: 5ad2402ba2a7f92682ba6c0e9c231fde9d624b9fa475dbc347edd3adaad8369e

Contents?: true

Size: 629 Bytes

Versions: 16

Compression:

Stored size: 629 Bytes

Contents

require 'sidekiq'

module Rollbar
  module Delay
    class Sidekiq
      OPTIONS = { 'queue' => 'rollbar', 'class' => Rollbar::Delay::Sidekiq }.freeze

      def initialize(*args)
        @options = (opts = args.shift) ? OPTIONS.merge(opts) : OPTIONS
      end

      def call(payload)
        raise StandardError, 'Unable to push the job to Sidekiq' if ::Sidekiq::Client.push(@options.merge('args' => [payload])).nil?
      end

      include ::Sidekiq::Worker

      def perform(*args)
        Rollbar.process_from_async_handler(*args)

        # Do not rescue. Sidekiq will call the error handler.
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rollbar-3.2.0 lib/rollbar/delay/sidekiq.rb
rollbar-3.1.2 lib/rollbar/delay/sidekiq.rb
rollbar-3.1.1 lib/rollbar/delay/sidekiq.rb
rollbar-3.1.0 lib/rollbar/delay/sidekiq.rb
rollbar-3.0.1 lib/rollbar/delay/sidekiq.rb
rollbar-3.0.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.27.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.27.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.26.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.26.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.25.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.25.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.24.0 lib/rollbar/delay/sidekiq.rb
rollbar-2.23.2 lib/rollbar/delay/sidekiq.rb
rollbar-2.23.1 lib/rollbar/delay/sidekiq.rb
rollbar-2.23.0 lib/rollbar/delay/sidekiq.rb