Class: SidekiqUniqueJobs::Server::Middleware
- Inherits:
-
Object
- Object
- SidekiqUniqueJobs::Server::Middleware
- Includes:
- OptionsWithFallback
- Defined in:
- lib/sidekiq_unique_jobs/server/middleware.rb
Overview
The unique sidekiq middleware for the server processor
Constant Summary
Constants included from OptionsWithFallback
Instance Method Summary collapse
-
#call(worker_class, item, queue) { ... } ⇒ Object
Runs the server middleware Used from Sidekiq::Processor#process.
Methods included from OptionsWithFallback
#lock, #lock_class, #lock_type, #log_duplicate_payload?, #options, #unique_disabled?, #unique_enabled?, #unique_type
Instance Method Details
#call(worker_class, item, queue) { ... } ⇒ Object
Runs the server middleware
Used from Sidekiq::Processor#process
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sidekiq_unique_jobs/server/middleware.rb', line 18 def call(worker_class, item, queue) @worker_class = worker_class @item = item @queue = queue return yield if unique_disabled? lock.execute do yield end end |