views:

70

answers:

2

Hay guys, I'm looking into reading about 'push' technology, but i think i may have heard about it in the wrong way. Is there are interesting things i should know about it? How can it be done in PHP? Can it be done in PHP? What's the general idea behind push?

Thanks

A: 

You need to take a look at these http://en.wikipedia.org/wiki/Comet%5F%28programming)

http://www.zeitoun.net/articles/comet%5Fand%5Fphp/start

Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. This technique will produce more responsive applications than classic AJAX. In classic AJAX applications, web browser (client) cannot be notified in real time that the server data model has changed. The user must create a request (for example by clicking on a link) or a periodic AJAX request must happen in order to get new data fro the server.

Pasta
For quick reference (and a slightly different explanation):The way this is commonly achieved is my utilising a "hanging GET". If you have some message passing system that can be polled for new messages (say a database table) and a JavaScript enabled browser you can instruct the browser to send a GET request (using some AJAX'y call) which then does not return from the server until a messages arrives or a timeout is reached. In either case the GET is just started up again while, or after, any incoming message(s) is dispatched.
Neel
A: 

It can sorta be done in PHP, but there are some issues with scaling. If scaling doesn't matter too much, then you can create a pseudo-comet client by simply having a page that doesn't return immediately.

If you're looking for something that scales a bit better, you'll either have to get a full comet server, or go with a SaaS solution (like WebSync On-Demand - disclaimer, I work there).

jvenema