redis - 一个异步队列处理与用户交互体验的问题
为情所困
为情所困 2017-04-28 09:04:25
0
2
679

我在一个抢购页面,点了“抢购”按钮请求到后端,后端会把此操作放入队列中,然后进行排队处理,但是此时对于前端用户来说,我怎么给他一个交待呢,他还在那个页面等结果呢,而队列不知道什么时候才处理到他的请求。

为情所困
为情所困

reply all(2)
巴扎黑

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...

Ty80

Give the front-end a token to query the processing status regularly, and then the front-end polls.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template