lib/attention/redis_pool.rb in attention-0.0.1 vs lib/attention/redis_pool.rb in attention-0.0.2

- old
+ new

@@ -1,19 +1,25 @@ require 'redis' require 'redis-namespace' require 'connection_pool' module Attention + # A ConnectionPool of Redis connections used by {Publisher}s class RedisPool + # @!visibility private attr_reader :pool + # @return [RedisPool] A singleton instance of the ConnectionPool def self.instance @instance ||= new @pool ||= ->{ @instance.pool.with{ |redis| redis } } end private + # As this is a singleton, +RedisPool.new+ is not public + # @!visibility public + # @api private def initialize pool_config = { size: Attention.options[:pool_size], timeout: Attention.options[:timeout] }