Class: Jiggler::RedisStore
- Inherits:
-
Object
- Object
- Jiggler::RedisStore
- Defined in:
- lib/jiggler/redis_store.rb
Instance Method Summary collapse
- #async_pool ⇒ Object
-
#initialize(options = {}) ⇒ RedisStore
constructor
A new instance of RedisStore.
- #pool ⇒ Object
- #sync_pool ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RedisStore
Returns a new instance of RedisStore.
7 8 9 |
# File 'lib/jiggler/redis_store.rb', line 7 def initialize( = {}) @options = end |
Instance Method Details
#async_pool ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/jiggler/redis_store.rb', line 15 def async_pool @async_pool ||= begin config = RedisClient.config(url: @options[:redis_url], timeout: nil) Async::Pool::Controller.wrap(limit: @options[:concurrency]) do config.new_client end end end |
#pool ⇒ Object
11 12 13 |
# File 'lib/jiggler/redis_store.rb', line 11 def pool @options[:async] ? async_pool : sync_pool end |
#sync_pool ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jiggler/redis_store.rb', line 24 def sync_pool @sync_pool ||= begin config = RedisClient.config(url: @options[:redis_url]) pool = config.new_pool(size: @options[:concurrency]) def pool.acquire(&block) with(&block) end pool end end |