I had set up a server sent event script with php and a while loop, I did not want for the script to have to keep closing and have to repoll so I put it all in a while loop.

The issue was that the script was getting stuck and I had to abandon that route and I went with a node.js websocket backend instead.