Module: Stockpile::RedisConnection
- Defined in:
- lib/stockpile/redis_connection.rb
Overview
Stockpile::RedisConnection
Wrapper around ConnectionPool and Redis to provide connectivity to Redis with desired configuration and sane connection pool
Class Method Summary collapse
- .connection_options ⇒ Object
- .connection_pool ⇒ Object
- .connection_pool_options ⇒ Object
- .connection_timeout ⇒ Object
- .pool_size ⇒ Object
- .redis_url ⇒ Object
- .sentinels ⇒ Object
Class Method Details
.connection_options ⇒ Object
31 32 33 34 |
# File 'lib/stockpile/redis_connection.rb', line 31 def { url: redis_url, sentinels: sentinels } end |
.connection_pool ⇒ Object
25 26 27 28 29 |
# File 'lib/stockpile/redis_connection.rb', line 25 def connection_pool @connection_pool = ConnectionPool.new() do Redis.new() end end |
.connection_pool_options ⇒ Object
36 37 38 39 |
# File 'lib/stockpile/redis_connection.rb', line 36 def { size: pool_size, timeout: connection_timeout } end |
.connection_timeout ⇒ Object
41 42 43 |
# File 'lib/stockpile/redis_connection.rb', line 41 def connection_timeout Stockpile.configuration.connection_timeout end |
.pool_size ⇒ Object
45 46 47 |
# File 'lib/stockpile/redis_connection.rb', line 45 def pool_size Stockpile.configuration.connection_pool end |
.redis_url ⇒ Object
49 50 51 |
# File 'lib/stockpile/redis_connection.rb', line 49 def redis_url Stockpile.configuration.redis_url end |
.sentinels ⇒ Object
53 54 55 |
# File 'lib/stockpile/redis_connection.rb', line 53 def sentinels Stockpile.configuration.sentinels end |