Currently I am calling a PHP script every 500 milliseconds (I want it to be a "live" chat) to get the latest chat messages and place them in the widget on the website. It all works fine but I am wondering if there's a better way to handle the message retrieving. Something like a callback when someone posts a message and only then ask PHP for new chat results.
Am I doing it the right way or are there better options.
Thanks for helping!