Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

websocket - Ways for notifying about result of a short background task

A user can trigger a task that takes approximately 5 seconds. What are the pros and cons of each of the ways to notify him about the response in terms like scalability, memory, resources and performance?

  1. Websocket
  2. Polling in order to check if the task is done(maybe every second)
  3. One request, waiting until the task is finished and then return the result(Long polling).

As I understand, for a longer task Websocket has more advantages, because the initialization overhead is small compared to the duration of the task, but in this case it is different.

question from:https://stackoverflow.com/questions/65599990/ways-for-notifying-about-result-of-a-short-background-task

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...