Module: SidekiqUniqueJobs::Middleware

Defined in:
lib/sidekiq_unique_jobs/middleware.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object


7
8
9
10
11
# File 'lib/sidekiq_unique_jobs/middleware.rb', line 7

def self.extended(base)
  base.class_eval do
    configure_middleware
  end
end

Instance Method Details

#configure_client_middlewareObject


32
33
34
35
36
37
38
39
# File 'lib/sidekiq_unique_jobs/middleware.rb', line 32

def configure_client_middleware
  Sidekiq.configure_client do |config|
    config.client_middleware do |chain|
      require 'sidekiq_unique_jobs/client/middleware'
      chain.add SidekiqUniqueJobs::Client::Middleware
    end
  end
end

#configure_middlewareObject


13
14
15
16
# File 'lib/sidekiq_unique_jobs/middleware.rb', line 13

def configure_middleware
  configure_server_middleware
  configure_client_middleware
end

#configure_server_middlewareObject


18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sidekiq_unique_jobs/middleware.rb', line 18

def configure_server_middleware
  Sidekiq.configure_server do |config|
    config.client_middleware do |chain|
      require 'sidekiq_unique_jobs/client/middleware'
      chain.add SidekiqUniqueJobs::Client::Middleware
    end

    config.server_middleware do |chain|
      require 'sidekiq_unique_jobs/server/middleware'
      chain.add SidekiqUniqueJobs::Server::Middleware
    end
  end
end