“Spawn a thread”-like behaviour in node.js

后端 未结 2 1666
盖世英雄少女心
盖世英雄少女心 2021-01-18 23:25

I want to add some admin utilities to a little Web app, such as \"Backup Database\". The user will click on a button and the HTTP response will return immediately, although

2条回答
  •  孤街浪徒
    2021-01-19 00:12

    As supertopi said you could have a look at Child process. But I think it will hurt the performance of your server, if this happens a lot sequentially. Then I think you should queue them instead. I think you should have a look at asynchronous message queues to process your jobs offline(distributed). Some(just to name two) example of message queues are beanstalkd, gearman.

提交回复
热议问题