You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using node-pool to handle multiple socket connections, when the connection goes down I need to be able to delete the socket resource from the pool, but looks like node-pool lacks this API.
I know pool.destroy will destroy the resource but this just works for previously borrowed resources which is not the case.
Is there any way to delete a resource from the pool that has not been previously borrowed?
The text was updated successfully, but these errors were encountered:
The only way out-of-the-box I think to do with would be to create a custom evictor that periodically checks the status of each connection in the pool and deletes anything that fails whatever check you specify.
As long as you create an Evictor class that has an instance method of evictthat accepts (poolConfig, resourceToCheck, availableObjectsCount) and returns a boolean, false to keep the resource and true to destroy the resource, it should be ok.
I'm using node-pool to handle multiple socket connections, when the connection goes down I need to be able to delete the socket resource from the pool, but looks like node-pool lacks this API.
I know pool.destroy will destroy the resource but this just works for previously borrowed resources which is not the case.
Is there any way to delete a resource from the pool that has not been previously borrowed?
The text was updated successfully, but these errors were encountered: