Sha256: c75276ed54ce800faa7662d7bef91be46da5545d2c928de048594720feda5ac3

Contents?: true

Size: 478 Bytes

Versions: 18

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

# 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"] do |strategy|
          strategy.finalize!(msg["jid"], *msg["args"])
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
sidekiq-throttled-0.15.1 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.18.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.17.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.16.2 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.16.1 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.16.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.15.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.14.1 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.13.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.12.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.11.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.10.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.10.0.beta lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.10.0.alpha lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.9.0 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.8.2 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.8.1 lib/sidekiq/throttled/middleware.rb
sidekiq-throttled-0.8.0 lib/sidekiq/throttled/middleware.rb