Socket io loop calls emit

I called the emit method of socket in the loop to send events to the front end, and sleep each loop for 1 second. However, in the course of testing, it is found that the front end is cumulative to handle these events. For example, I looped 10 times, and instead of responding to an event every second, the front end processed the cumulative 10 responses together at the end of the final loop.

Mar.02,2021

hi Hello, I would like to ask, do you have a solution now? Thank you very much

Menu