I want PHP to execute a method in a loop to detect communication until the client returns true to stop the loop, otherwise it will continue to loop communication 10 times. What is the best way to implement this type of loop execution method? Because thousands of checks are required at the same time, it may be resource-intensive.
I want PHP to execute a method in a loop to detect communication until the client returns true to stop the loop, otherwise it will continue to loop communication 10 times. What is the best way to implement this type of loop execution method? Because thousands of checks are required at the same time, it may be resource-intensive.
You can’t do it with pure http protocol. You can use websocket in swoole to solve your needs.