-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Queue is blocked after queue.kill() #1422
Comments
Our current model is that after |
OK, coincidentally that's what I ended up doing myself but we might wanna add a note to the documentation so other folks don't stumble. 👍 |
Added a note to the |
So the docs now say:
my question is - if we keep adding a few tasks to the queue, I am pretty sure nothing will break. What the docs should say - if you want to process new tasks, you need to use a new queue instance. Isn't that right? |
What version of async are you using?
This behavior occurs on all versions of
async
, but I'm using the latest.Which environment did the issue occur in (Node version/browser version)
Node
v7.x.y
What did you do? Please include a minimal reproducable case illustrating issue.
I'm using a queue with concurrency of 1. I'm adding tasks to it that can take a long time. Sometimes I want to empty the queue, kill its current running operation, and "retry now" by enqueuing a new operation.
Reading the documentation,
queue.kill()
seemed ideal for this.What did you expect to happen?
I expected
queue.kill()
to put the queue into a kind of empty, clean state. Adding a new operation after callingkill
should execute it immediately.What was the actual result?
The current running operation is left orphaned, and any newly queued operations are stuck waiting for it, forever.
The text was updated successfully, but these errors were encountered: