Skip to content
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.

pool.end() needs to process pending queries #132

Open
ghost opened this issue Sep 20, 2019 · 1 comment · May be fixed by #133
Open

pool.end() needs to process pending queries #132

ghost opened this issue Sep 20, 2019 · 1 comment · May be fixed by #133

Comments

@ghost
Copy link

ghost commented Sep 20, 2019

pool.end() processes the queries in the active connections but then drops all other pending queries, there really needs to be an option to also process all pending queries or end() needs to be changed to finish pending queries before shutting down. Other libraries like the mongodb-node driver finish pending queries with the close() method rather than drop pending queries. Users most likely want queries to finish after queuing them up and get a callback for when those are done

@ghost ghost changed the title add option for pool.end() to also process pending queries pool.end() needs to process pending queries Nov 1, 2019
@gajus
Copy link

gajus commented Nov 10, 2019

For what it is worth, I have implemented this functionality in Slonik.

https://github.com/gajus/slonik#slonik-usage-end-connection-pool

Of course, the majority of the work is still done by pg-pool. Slonik simply enables this functionality by patching pg-pool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant