Sha256: 0aecf1dcdb980b51a5c9846213e1b5841cea8f8ffe517327be84858b55c4ef15

Contents?: true

Size: 1.07 KB

Versions: 30

Compression:

Stored size: 1.07 KB

Contents

require 'shoryuken'

module Rollbar
  module Delay
    # Following class allows to send rollbars using Sho-ryu-ken as a background jobs processor.
    # see the queue_name method which states that your queues needs to be names as "rollbar_ENVIRONMENT".
    # retry intervals will be used to retry sending the same message again if failed before.
    class Shoryuken
      include ::Shoryuken::Worker

      class << self
        attr_accessor :queue
      end

      self.queue = "rollbar_#{Rollbar.configuration.environment}"

      def self.call(payload)
        new.call(payload, :queue => queue)
      end

      def call(payload, options = {})
        self.class.perform_async(payload, options)
      end

      # not allowing bulk, to not double-report rollbars if one of them failed in bunch.
      shoryuken_options :auto_delete => true,
                        :body_parser => :json,
                        :retry_intervals => [60, 180, 360, 120_0, 360_0, 186_00]

      def perform(_sqs_message, payload)
        Rollbar.process_from_async_handler(payload)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

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