Sha256: f00c04e263aaed66464aa0f58e19cdfc80cfabd1a63b8ce9738630419d8137f9

Contents?: true

Size: 785 Bytes

Versions: 44

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

module Labkit
  module Middleware
    module Sidekiq
      # This is a wrapper around all the sidekiq server-middleware in labkit
      # The only middleware that needs to be added to the chain in GitLab-rails
      #
      # It uses a new `Sidekiq::Middleware::Chain` to string multiple middlewares
      # together.
      class Server
        def self.chain
          @chain ||= ::Sidekiq::Middleware::Chain.new do |chain|
            chain.add Labkit::Middleware::Sidekiq::Context::Server
            chain.add Labkit::Middleware::Sidekiq::Tracing::Server if Labkit::Tracing.enabled?
          end
        end

        def call(*args)
          self.class.chain.invoke(*args) do
            yield
          end
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
gitlab-labkit-0.36.1 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.36.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.35.1 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.35.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.34.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.33.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.32.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.31.1 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.31.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.30.1 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.30.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.29.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.28.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.27.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.26.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.25.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.24.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.23.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.22.0 lib/labkit/middleware/sidekiq/server.rb
gitlab-labkit-0.21.3 lib/labkit/middleware/sidekiq/server.rb