Sha256: 8f8eaa738e1410dbe43e9f99feab592cd925839cff0c193c5d798ceb4afd96bf

Contents?: true

Size: 302 Bytes

Versions: 3

Compression:

Stored size: 302 Bytes

Contents

module QPush
  class << self
    attr_reader :redis_pool

    def redis
      @redis_pool ||= RedisPool.create
    end
  end

  class RedisPool
    def self.create
      ::ConnectionPool.new(size: QPush.config.redis_pool) do
        ::Redis.new(url: QPush.config.redis_url)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qpush-0.1.2 lib/qpush/redis.rb
qpush-0.1.1 lib/qpush/redis.rb
qpush-0.1.0 lib/qpush/redis.rb