Sha256: b58e58f7fed90f9e8204156539a66e6a7316c2d34cf76079a5ceb7ecec447f0e

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

require 'sidekiq'

module SidekiqUniqueJobs
  module Middleware
    def self.extended(base)
      base.class_eval do
        configure_middleware
      end
    end

    def configure_middleware
      configure_server_middleware
      configure_client_middleware
    end

    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

    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
  end
end
SidekiqUniqueJobs.send(:extend, SidekiqUniqueJobs::Middleware)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-5.0.2 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-5.0.1 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-5.0.0 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.18 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.17 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.16 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.15 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.13 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.12 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.11 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.10 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-4.0.9 lib/sidekiq_unique_jobs/middleware.rb