-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix(clearQueue): reject pending promises #27
Conversation
@copperwall Any thoughts on this? I need to get this merged or closed before releasing a new version. |
I think it looks pretty good. I tested it out by running a bunch of axios requests with a concurrency and running the clearQueue function in a setTimeout that ran after two seconds as a sort of timeout on the queue. The changes are helpful if you're awaiting a I resolved the merge conflicts in a branch with the same name on my fork if you'd like to merge that in. https://github.com/copperwall/p-limit/tree/clear-queue-reject |
BREAKING CHANGE: when clearQueue() is called, promises for queued function calls will be rejected. fix sindresorhus#25
5941a9c
to
12bfa81
Compare
okay, I made the requested changes and rebased |
Would this better served as a separate method, like |
I don't really like the idea of never settling a promise, it will cause confusion. I think we should reject the pending promises by default and if the user wants to leave them unsettled (what for though?) they should have to opt into that. |
This is really only an issue if people are actually waiting for the promise returned by |
I was looking at using this library to serialize queries on an MSSQL connection, which required the |
Here's what I meant in #25
BREAKING CHANGE: when clearQueue() is called, promises for queued function calls will be rejected.
fix #25