One modern way to do this is to use a server-push system, such as WebSockets or Socket.io, and not a client-push system, which sometimes asks for the status of "there is something new."
With this type of technology, the connection with the client (I assume that it is a web browser) on the server is always open, and whenever something happens on the server, the server pushes data directly to the client.
For code and examples, check out http://socket.io/
Not all server technologies are compatible with this type of approach, but one very good one is Node.js, which allows you to write event-driven server-side code in Javascript. See http://nodejs.org
If you decide to use Node.js on the server and want to interact with browsers, there is even Now.js (see http://nowjs.com/ ) that allows you to actually perform call functions on the client from the server!
source share