Module: SlowRide
- Defined in:
- lib/slow_ride.rb,
lib/slow_ride/version.rb
Defined Under Namespace
Constant Summary collapse
- Error =
Class.new(StandardError)
- RedisNotConfigured =
Class.new(Error)
- VERSION =
"0.1.0"
Class Method Summary collapse
Class Method Details
.enable_redis(max_connections: 25, &block) ⇒ Object
12 13 14 |
# File 'lib/slow_ride.rb', line 12 def enable_redis(max_connections: 25, &block) @redis_pool = ConnectionPool.new(size: max_connections, &block) end |
.redis(&block) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/slow_ride.rb', line 16 def redis(&block) if @redis_pool @redis_pool.with(&block) else raise RedisNotConfigured, "Must configure Redis with `SlowRide.enable_redis { Redis.new(...) }`" end end |