Sha256: e0d226f50a01cf354df0ee5a3645aba9961928a9206d254ccd1b7d42f823ef10

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

# internal
require "sidekiq/throttled/registry"

module Sidekiq
  module Throttled
    # Server middleware that notifies strategy that job was finished.
    # @private
    class Middleware
      # Called within Sidekiq job processing
      def call(_worker, msg, _queue)
        yield
      ensure
        Registry.get msg["class".freeze] do |strategy|
          strategy.finalize! msg["jid".freeze]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sidekiq-throttled-0.1.0 lib/sidekiq/throttled/middleware.rb