Sha256: 8327dcfc95ea36968949a46d4babfefa0966fe12efe6c0b1d16b24cfd23d8bc7

Contents?: true

Size: 1.06 KB

Versions: 25

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

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

25 entries across 25 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.8 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.7 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-5.0.11 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.6 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.5 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.4 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.3 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.2 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.1 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc8 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc7 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc6 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc5 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc4 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc3 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc2 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-6.0.0.rc1 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-5.0.10 lib/sidekiq_unique_jobs/middleware.rb
sidekiq-unique-jobs-5.0.9 lib/sidekiq_unique_jobs/middleware.rb