Module: Rollie
- Defined in:
- lib/rollie.rb,
lib/rollie/status.rb,
lib/rollie/version.rb,
lib/rollie/redis_pool.rb,
lib/rollie/rate_limiter.rb
Defined Under Namespace
Classes: RateLimiter, RedisPool, Status
Constant Summary collapse
- VERSION =
"0.1.1".freeze
Class Method Summary collapse
- .redis ⇒ Object
-
.redis=(options) ⇒ Object
Configures the redis connection pool.
- .redis_pool ⇒ Object
Class Method Details
.redis ⇒ Object
9 10 11 12 13 14 |
# 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) ⇒ Object
Configures the redis connection pool. Options can be a hash of redis connection pool options or a pre-configured ConnectionPool instance.
24 25 26 27 28 29 30 |
# File 'lib/rollie.rb', line 24 def redis=() @redis_pool = if .is_a?(ConnectionPool) else Rollie::RedisPool.create() end end |