Wednesday, January 26, 2022

Conccurency Task queue

Spawning parallel tasks without control can often lead to excessive load. For instance sending bulk emails or downloads a lot of files slightly exceeds server resource limit.

In this post I am going to make a parallel tasks queue with concurrency limit control

This queue extends EventEmitter. It is possible to receive errors and get a message after finish.

Let see a queue:


Let see a examle:


Happy coding.

Resource: 


No comments:

Post a Comment