the existing requirements are as follows:
N threads retrieve similar data every second from various interfaces on different platforms, and do a cleaning and sorting operation on the data, and then send the data to the front end for display. The final effect is to display the data in real time.
the existing problems are as follows:
I set the counter and print the program results run by the thread per second. It is found that the data fetching action per second may fail, and the response may fail or the response delay may be delayed. The final result is > some of the existing N data may be within the current 1 second and some within the previous time. If the data is directly transmitted to the front end, then the data actually does not meet the requirements.
preliminary idea:
1. Send the data fetched by the thread per second to the front end using websocket, and then display it separately?
2. Set up a status field for the data you get every second, and check it according to the status field.
java has been developing for a year. It"s a bit confusing to come into contact with this problem for the first time, and ask the old bird to teach