在后台运行任务

时间:2018-10-08 10:41:49

标签: server-side serverside-javascript server-side-scripting

什么是允许Web应用程序在后台处理任务而无需让用户等待任务完成的技术?

Example, as a user,

 1. I want to submit a form which requires heavy processing. (Assume it requires to checking or actions, upload documentation or etc)

 2.   After submitting the form, the task will be running in the background, then I can go to other page and do something else.

    2.1   At the same time, I might submit another form to the server.
          The request can be process at the same time or can be queue under a queue system

 3. I will receive a notification from the system whenever the server return a response. (Regardless it is success or failure)

此功能类似于Google Cloud Platform。

1 个答案:

答案 0 :(得分:0)

尝试Kue或任何其他类似的库。 “ google”一词是“ [语言]任务队列”

您当然可以自己滚动。但是,如果使用现有的服务器(例如redis或rabbitmq)会容易得多。这样排队部分就由服务器为您处理,您就可以专注于业务逻辑。