Class: Labkit::Middleware::Sidekiq::Client
- Inherits:
-
Object
- Object
- Labkit::Middleware::Sidekiq::Client
- Defined in:
- lib/labkit/middleware/sidekiq/client.rb
Overview
This is a wrapper around all the sidekiq client-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 Method Summary collapse
Instance Method Summary collapse
Class Method Details
.chain ⇒ Object
12 13 14 15 16 17 |
# File 'lib/labkit/middleware/sidekiq/client.rb', line 12 def self.chain @chain ||= ::Sidekiq::Middleware::Chain.new do |chain| chain.add Labkit::Middleware::Sidekiq::Context::Client chain.add Labkit::Middleware::Sidekiq::Tracing::Client if Labkit::Tracing.enabled? end end |
Instance Method Details
#call(*args) ⇒ Object
19 20 21 22 23 |
# File 'lib/labkit/middleware/sidekiq/client.rb', line 19 def call(*args) self.class.chain.invoke(*args) do yield end end |