Lines Matching refs:pool
14 } = require('./pool-base')
15 const Pool = require('./pool')
70 if (this[kClients].find((pool) => (
71 pool[kUrl].origin === upstreamOrigin &&
72 pool.closed !== true &&
73 pool.destroyed !== true
77 const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
79 this[kAddClient](pool)
80 pool.on('connect', () => {
81 pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
84 pool.on('connectionError', () => {
85 pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
89 pool.on('disconnect', (...args) => {
92 // decrease the weight of the pool.
93 pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
114 const pool = this[kClients].find((pool) => (
115 pool[kUrl].origin === upstreamOrigin &&
116 pool.closed !== true &&
117 pool.destroyed !== true
120 if (pool) {
121 this[kRemoveClient](pool)
151 const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
159 let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
163 const pool = this[kClients][this[kIndex]]
165 // find pool index with the largest weight
166 if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
179 if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
180 return pool