node-pool
node-pool copied to clipboard
add "reset" method
"reset" method that can be overridden is a very important addition that will let a "resting" a resource before putting it back to the pool. The resource shouldn't be available until it was "rested" and should be released on err.
var poolModule = require('generic-pool');
var pool = poolModule.Pool({
reset: function(resource, done) {
resource.clean(function(err){}{
done(err);
});
}
}
Any update on this? Need to run some code after a resource is released to basically "clean" it before it is used again.