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

Categories

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...