How to use generic-pool

Comprehensive generic-pool code examples:

How to use generic-pool.Pool:

69
70
71
72
73
74
75
76
77
78
        });
    });
}

schema.adapter = new RethinkDB(s, schema);
schema.adapter.pool = gpool.Pool({
    name: "canario-rethink-pool",
    create: connect,
    destroy: function (client) {
        client.close();

How to use generic-pool.createPool:

324
325
326
327
328
329
330
331
332
333
      setImmediate(next);
    });
}

debug('Creating %s channel pool %o', mode, options.pool);
pool = genericPool.createPool(factory, options.pool);
pool.on('factoryCreateError', (err) => {
  debug('Create error emitted by %s channel pool: %s', mode, err.message);
});
pool.on('factoryDestroyError', (err) => {