Node.js/Express and parallel queues

后端 未结 4 1929
刺人心
刺人心 2020-12-30 04:16

We are building an infrastructure which features a Node.js server and Express.

In the server, what is happening is as follow:

  1. The server accepts an inc
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 04:28

    (Answering my own question)

    According to this question on Stack Overflow a solution in my case would be to implement a queue using Caolan McMahon's async module.

    The main application will create jobs and push them into a queue, which has a limit on the number of concurrent jobs that can run. This allows processing tasks concurrently but with a strict control on the limit. It works like Cocoa's NSOperationQueue on Mac OSX.

提交回复
热议问题