How is the status returned by the java asynchronous callback function notified to the foreground?

such as the question, with asynchronous functions also deal with data, but how to feedback to the foreground? It would be nice to give some ideas

Feb.26,2021

personally, I think the simplest way is to use short polling:

A1sB

can only poll one more interface, and the server cannot send a http request directly to the client.


WebSockets can make a web page dynamic and interactive. However in many cases a combination of Ajax and HTTP streaming and/or long polling could provide a simple and effective solution.

For example news, mail, and social feeds need to update dynamically but it may be perfectly okay to do so every few minutes. Collaboration, games, and financial apps on the other hand need to be much closer to real time.

Latency alone is not a deciding factor. If the volume of messages is relatively low (e.g. monitoring network failures) HTTP streaming or polling may provide an effective solution. It is the combination of low latency, high frequency and high volume that make the best case for the use WebSocket.

read the springboot websocket document . When to use polling and when to use websocket is very clear. I'd better use polling obediently

.

polling is also possible, or a WebSocket connection is established between the foreground and the backend. After the data is processed, the server pushes feedback directly to the client.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bdb753-307c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bdb753-307c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?