Answer the question
In order to leave comments, you need to log in
Run tasks in separate threads on nodejs while maintaining the maximum number of threads, what are the solutions?
Good day dear friends.
Let's take a look at the diagram right away.
I have a large pool of different tasks that need to be solved in parallel.
Each task can run for a different amount of time.
The first solution was simple, we create a pool of tasks, wait for the completion of all tasks, and so on in a circle.
But the problem is that there are tasks that are solved quite quickly, for example, in 3 seconds. and there are those that are solved slowly, for example, in 120 seconds. it turns out that until the last task is solved, the new pool will not be processed. I really want to get rid of this.
The following requirements must be met.
Answer the question
In order to leave comments, you need to log in
As a result - queues, any) there is a whole directory, if necessary . I'm rooting for RabbitMQ in most cases
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question