我在一个抢购页面,点了“抢购”按钮请求到后端,后端会把此操作放入队列中,然后进行排队处理,但是此时对于前端用户来说,我怎么给他一个交待呢,他还在那个页面等结果呢,而队列不知道什么时候才处理到他的请求。
You can make a pseudo progress bar. For example, after a rush purchase, there will be a progress bar being executed, or it can be as simple and crude as Xiaomi: Queuing, please wait patiently...
Give the front-end a token to query the processing status regularly, and then the front-end polls.
You can make a pseudo progress bar. For example, after a rush purchase, there will be a progress bar being executed, or it can be as simple and crude as Xiaomi: Queuing, please wait patiently...
Give the front-end a token to query the processing status regularly, and then the front-end polls.