Implement redis connection pooling, multi, and pipelines.

This commit is contained in:
kirby@puppetlabs.com 2020-04-24 15:14:47 -07:00
parent 52bf6c4c89
commit 9973ed878f
6 changed files with 234 additions and 204 deletions

View file

@ -156,6 +156,12 @@ module Vmpooler
pools
end
def self.redis_connection_pool(host, port, password, size = 10)
ConnectionPool.new(size: size) {
redis_connection(host, port, password)
}
end
def self.redis_connection(host = 'localhost', port = nil, password = nil)
Redis.new(host: host, port: port, password: password)
end