coopernurse / node-pool

Generic resource pooling for node.js
2.37k stars 259 forks source link

handle factoryCreate fail #221

Open rebareba opened 6 years ago

rebareba commented 6 years ago

if don't do this ,it would call factory.create() again and again . or I can do like this outside.

const pool = genericPool.createPool(factory, options);
  pool.on('factoryCreateError', function (err) {
    const clientResourceRequest = pool._waitingClientsQueue.dequeue();
    if (clientResourceRequest) {
      clientResourceRequest.reject(err);
    }
  })

Need change _waitingClientsQueue -> waitingClientsQueue and defined Pool.FACTORY_CREATE_ERROR = FACTORY_CREATE_ERROR;

apmcodes commented 4 years ago

Why is this not yet patched? Unable to use 3.x.