Sha256: 09daa9019ff606839041e91bf87e5d9c5fb76e7d33a8e141e6e3669e7e93568d

Contents?: true

Size: 578 Bytes

Versions: 50

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

module SidekiqUniqueJobs
  # Shared module for dealing with redis connections
  #
  # @author Mikael Henriksson <mikael@mhenrixon.com>
  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

50 entries across 50 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-7.1.13 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.12 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.11 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.10 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.8 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.13 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.7 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.6 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.5 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.3 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.2 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.1 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.0 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.12 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.11 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.10 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.9 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.8 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.7 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.0.6 lib/sidekiq_unique_jobs/connection.rb