-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
Remove queued query #2478
Comments
Hi @martinmacko47 thanks for this feature request. I don't see any reason why a feature to remove a queued query cannot be implemented. One tweak I may suggest to our original ideal is the following: what about adding a method like |
@dougwilson Thank you for your proposal, your solution is much better. Also have you any thoughts about pausing queue execution while we cancel current executing query? Potentially cancel is long and we do not want kill next query from execution queue. |
@dougwilson I agree with the tweak. I created a draft PR #2480 with the implementation. I added |
Won't methods |
@martinmacko47 🤔 they actually for streaming, as per docs. |
@dougwilson Hi, can you pls check my PR #2480? |
@dougwilson Hello. Is there anything I can do to have the PR checked? |
Would it be possible to add a connection method that would remove a queued (waiting) query from the connection queue? It would take a single parameter the query object as returned from
connection.query()
and it would remove the query from the queue if the query is waiting. It should respond with one of three states: query removed, query currently executing (can't be removed), query not found (probably already executed).A rough pseudocode what it would do (specific implementation details will need to be refined):
We need this feature for implementing timeouts in Knex.js, see this discussion knex/knex#4416 (comment). We don't want to hack the driver internals and we would prefer to use a supported feature. I'm willing to create a PR with the implementation if the feature would be accepted.
I'm filing a symmetric feature request to
mysql2
driver sidorares/node-mysql2#1316. It would be good to implement it in a compatible way in both drivers.The text was updated successfully, but these errors were encountered: