Other events
It would be very nice to have the queue emit other events, such as empty.
What other events than empty?
Sorry, I should have been more explicit. I like the active event. I wish I had other events such as idle and empty. For example, I would like to do something like:
queue.on('empty', () => {
// Since the queue is empty, we have time for other things
console.log(`Will flush out metrics/logs now!`);
logger.flush();
metrics.flush();
});
Does this make sense? I could do some promise "calisthenics" on top of the queue.onEmpty, but I would need to keep "awaiting" repeatedly to get a callback every time the queue becomes empty.
Cheers and thanks for a great library.
@acrodrig @sindresorhus I added idle event and submitted a PR with it #109
I'd like to toss in a request for limitReached or some such that would notify when the queue is effectively paused because the intervalCap had been reached for a given interval. There's a good bit of processing that I'd like to do in that scenario.