We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finally
There are sometimes resources attached to a connection that need cleaning up – e.g. database connection that's been checked out from a pool.
createSelector(getA, getB, getC, async (a, b, c) => { return await dbPool.checkout(); // how to clean up this connection? });
Possible option:
createSelector(getA, getB, getC, async (a, b, c) => { return await dbPool.checkout(); }).withDisposer(async (a, b, c, con) => { return await dbPool.release(con); });
The text was updated successfully, but these errors were encountered:
NOTE: I think this could be solved with Observable. See: https://github.com/tc39/proposal-observable.
Observable
Something like
createSelector(() => { return new Observable(observer => { const connection = await dbPool.checkout(); next(connection); return () => { connection.release(); }; });
Something similar for creating the dbPool object itself as well.
dbPool
const dbPool = new Observable(observer => { const dbPool = ...; next(dbPool); return () => { await dbPool.end(); }; });
Except the difference here being the observe would trigger on server creation and shutdown instead of on request.
Sorry, something went wrong.
No branches or pull requests
There are sometimes resources attached to a connection that need cleaning up – e.g. database connection that's been checked out from a pool.
Possible option:
The text was updated successfully, but these errors were encountered: