tags:

views:

19

answers:

1

A server is a PHP RESTful web service, a client can be an AJAX GUI or a desktop Java application. A client has to update presentation as soon as a web-service-provided value changes. How to implement this? Polling a web service from time to time does not seem an efficient solution, IMHO. A web service has to be able to notify a subscriber about update events some way. What are common best practices for this case?

A: 

A web service isn't generally something that notifies its clients. "Polling from time to time ", as you've said, is a working solution - RSS seems right for your scenario (or any other form of XML or even JSON, which your service is already outputing).
If you want your clients to react to server events, you probably need something stronger than a web service.

Kobi
Isn't XMPP a good idea? (actually I don't yet have an idea of how does an XMPP server push a message to a client, but if it does, then it could be better than RSS as RSS still has to be polled by client).
Ivan
There are many viable options. I just stated that these protocols go an extra step from a regular web service - I tend to think on a service as passive.
Kobi