Polling server without timer in vue is easy to crash.

is there any good polling method that does not use setInterval

Sep.17,2021

websocket;
setTimeout can also be polled;
setInterval causing a crash should be a problem with your code structure


1. Can be changed to websocket
2. Write timer in the form of setTimeout recursion (this is more accurate)
3.setInterval causes the server to crash. You can call the timer repeatedly. You can see whether the request is repeated by F12. The code problem is not the problem of timer.


personally, I think websocket will be very good, and both sides can push messages actively

.
Menu