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.2'
Class Method Summary collapse
- .redis(&block) ⇒ Object
-
.redis=(options) ⇒ Object
Configures the redis connection pool.
- .redis_pool ⇒ Object
Class Method Details
.redis(&block) ⇒ Object
10 11 12 13 14 |
# File 'lib/rollie.rb', line 10 def redis(&block) raise ArgumentError, 'requires a block' unless block redis_pool.with(&block) 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 |