class Sidekiq::Pool
- Sidekiq::Pool
- Reference
- Object
Defined in:
sidekiq/pool.crConstructors
-
.new(size : Int32)
Set up a pool of connections to Redis on localhost:6379:
- .new(cfg : RedisConfig)
Instance Method Summary
-
#redis(&)
Execute one or more Redis operations:
Constructor Detail
def self.new(size : Int32)
#
Set up a pool of connections to Redis on localhost:6379:
Sidekiq::Pool.new(5)
Instance Method Detail
def redis(&)
#
Execute one or more Redis operations:
pool.redis do |conn|
conn.set("mike", "rules") => "OK"
conn.get("mike") => "rules"
end
Or as a transaction:
pool.redis do |conn|
conn.multi do |multi|
multi.set("mike", "rules")
multi.get("mike")
end => ["OK", "mike"]
end