Sha256: 2d382dbb48750ea1165da7cc093889c22b57ec10ff9a7856a2c5ed02b3dbaafe

Contents?: true

Size: 578 Bytes

Versions: 24

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

module SidekiqUniqueJobs
  # Shared module for dealing with redis connections
  #
  # @author Mikael Henriksson <mikael@zoolutions.se>
  module Connection
    def self.included(base)
      base.send(:extend, self)
    end

    # Creates a connection to redis
    # @return [Sidekiq::RedisConnection, ConnectionPool] a connection to redis
    def redis(r_pool = nil, &block)
      r_pool ||= defined?(redis_pool) ? redis_pool : r_pool
      if r_pool
        r_pool.with(&block)
      else
        Sidekiq.redis(&block)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-7.0.0.beta25 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta24 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta23 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta22 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta21 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta20 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta19 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta18 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta17 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta16 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta15 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta14 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta13 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta12 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta11 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta10 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta9 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta8 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta7 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.0.beta6 lib/sidekiq_unique_jobs/connection.rb