module Rollie

Constants

VERSION

Public Class Methods

redis() { |conn| ... } click to toggle source
# File lib/rollie.rb, line 9
def redis
  raise ArgumentError, "requires a block" unless block_given?
  redis_pool.with do |conn|
    yield(conn)
  end
end
redis=(options) click to toggle source

Configures the redis connection pool. Options can be a hash of redis connection pool options or a pre-configured ConnectionPool instance.

@option options [String] :url The redis connection URL @option options [String] :driver The redis driver @option options [Integer] :pool_size Size of the connection pool @option options [Integer] :pool_timeout Pool timeout in seconds @option options [String] :namespace Optional namespace for redis keys

# File lib/rollie.rb, line 24
def redis=(options)
  @redis_pool = if options.is_a?(ConnectionPool)
    options
   else
    Rollie::RedisPool.create(options)
   end
end
redis_pool() click to toggle source
# File lib/rollie.rb, line 32
def redis_pool
  @redis_pool ||= Rollie::RedisPool.create
end