- Notifications
You must be signed in to change notification settings - Fork2.4k
Closed
Description
I'm currently finding a way to remove certain unprocessed entries in a queue/priorityQueue. I don't know how to do it, so I would appreciate if anyone could give me a hint.
Feature suggestion: add another method with which entries gets removed like that:
var q = async.queue(function (task, callback) { callback();});q.push({some: 'thing'});q.remove(function (task) { return task.some === 'thing'; // remove task if return value is true});Or with the priority queue:
var q = async.priorityQueue(function (task, callback) { callback();}, 3);q.push({some: 'thing'}, 100);q.remove(function (task, priority) { return task.some === 'thing'; // remove task if return value is true or return priority === 100; // remove task with certain priority});