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 happy to have a go at this. I just wanted to float the idea first and see what you all think. 👍
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
I have a connection pool that wraps tedious connections. With some of our integration tests, we spin up an app and don't have a easy reference to the pool (and the connections underneath). With an idle connection, the test exit hangs.
It would be nice if the connection's socket was ref/unref'd as it was in use or idle. This would allow the node process to shut down even with an open connection.
Describe the preferred solution
This could be a connection config option, though I'm not sure if there is any harm in making it a default behavior.
Describe alternatives you've considered
I currently have access to the socket property on the connection and can successfully ref/unref from outside. That property is marked private though, so I was reluctant to solve it this way in case the connection internals change.
Of course, fixing the tests to properly dispose the pool is the best alternative. 😄
Additional context
We use generic-pool and they also unref their timers to prevent blocking node's exit. generic-pool
Reference Documentations/Specifications
Node docs are here: unref and ref.
The text was updated successfully, but these errors were encountered:
I'm happy to have a go at this. I just wanted to float the idea first and see what you all think. 👍
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
I have a connection pool that wraps tedious connections. With some of our integration tests, we spin up an app and don't have a easy reference to the pool (and the connections underneath). With an idle connection, the test exit hangs.
It would be nice if the connection's socket was
ref
/unref
'd as it was in use or idle. This would allow the node process to shut down even with an open connection.Describe the preferred solution
This could be a connection config option, though I'm not sure if there is any harm in making it a default behavior.
Describe alternatives you've considered
I currently have access to the socket property on the connection and can successfully
ref
/unref
from outside. That property is marked private though, so I was reluctant to solve it this way in case the connection internals change.Of course, fixing the tests to properly dispose the pool is the best alternative. 😄
Additional context
We use generic-pool and they also
unref
their timers to prevent blocking node's exit. generic-poolReference Documentations/Specifications
Node docs are here: unref and ref.
The text was updated successfully, but these errors were encountered: