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)
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 calling kill 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:
Our current model is that after q.kill() you would no longer use that queue, and you would create a new queue if you wanted to continue processing. We'd have to do a lot more internal cleanup if the queue were able to be "resurrected".
kill | function | a function that removes the drain callback and empties remaining tasks from the queue forcing it to go idle. No more tasks should be pushed to the queue after calling this function. Invoke with queue.kill().
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.