首页 > 解决方案 > 在后台运行任务

问题描述

什么是允许 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。

标签: server-sideserverside-javascriptserver-side-scripting

解决方案


尝试Kue或任何其他类似的库。“谷歌”的术语是“[语言]任务队列”

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


推荐阅读