Sha256: 8aef5823656812748d0032f72dc3318a3ccd9873e01787c429b1a959252c796e

Contents?: true

Size: 726 Bytes

Versions: 8

Compression:

Stored size: 726 Bytes

Contents

module Rollbar
  module Delay
    class GirlFriday
      class << self
        def queue_class
          ::GirlFriday::WorkQueue
        end

        def call(payload)
          new.call(payload)
        end

        def queue
          @queue ||= queue_class.new(nil, :size => 5) do |payload|
            begin
              Rollbar.process_from_async_handler(payload)
            rescue StandardError
              # According to https://github.com/mperham/girl_friday/wiki#error-handling
              # we reraise the exception so it can be handled some way
              raise
            end
          end
        end
      end

      def call(payload)
        self.class.queue.push(payload)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rollbar-2.22.1 lib/rollbar/delay/girl_friday.rb
rollbar-2.22.0 lib/rollbar/delay/girl_friday.rb
rollbar-2.21.0 lib/rollbar/delay/girl_friday.rb
rollbar-2.20.2 lib/rollbar/delay/girl_friday.rb
rollbar-2.20.1 lib/rollbar/delay/girl_friday.rb
rollbar-2.20.0 lib/rollbar/delay/girl_friday.rb
rollbar-2.19.4 lib/rollbar/delay/girl_friday.rb
rollbar-2.19.3 lib/rollbar/delay/girl_friday.rb