Background processes in Node.js

前端 未结 6 1606
刺人心
刺人心 2020-12-22 16:48

What is a good aproach to handle background processes in a NodeJS application?

Scenario: After a user posts something to an app I want to crunch th

6条回答
  •  一个人的身影
    2020-12-22 17:21

    If you want something lightweight, that runs in the same process as the server, I highly recommend Bull. It has a simple API that allows for a fine grained control over your queues.

    If you're looking for something that runs as a standalone worker process, perhaps look into Kue. It can run as a RESTful API server, and even has several front-end apps written for it.

    If you're familiar with Ruby's Resque, there is a node implementation called Node-resque

    Bull, Kue and Node-resque are all backed by Redis, which is ubiquitous among Node.js worker queues. All 3 would be able to do what RoR's DelayedJob does, it's matter of specific features that you want, and your API preferences.

提交回复
热议问题