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.33 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.32 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.31 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.30 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.29 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.28 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.27 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.26 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.25 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.24 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.23 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.22 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.21 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.20 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.19 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.18 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.17 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.16 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.15 lib/sidekiq_unique_jobs/connection.rb
sidekiq-unique-jobs-7.1.14 lib/sidekiq_unique_jobs/connection.rb