mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Implement redis connection pooling, multi, and pipelines.
This commit is contained in:
parent
52bf6c4c89
commit
9973ed878f
6 changed files with 234 additions and 204 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue