I want php to execute a method cyclically to detect communication until the client returns true to stop this loop. Otherwise, it will communicate continuously for 10 times. Which method is better to implement this type of cyclic execution method? Because it requires thousands of checks at the same time, it may consume resources. I want php to execute a method cyclically to detect communication until the client returns true to stop this loop. Otherwise, it will communicate continuously for 10 times. Which method is better to implement this type of cyclic execution method? Because it requires thousands of checks at the same time, it may consume resources.
Reply content:
I want php to execute a method cyclically to detect communication until the client returns true to stop this loop. Otherwise, it will communicate continuously for 10 times. Which method is better to implement this type of cyclic execution method? Because it requires thousands of checks at the same time, it may consume resources.
You can use websocket in swoole to solve your needs.