I have a REST based web service system. I need to find a way to support publish/subscribe model here. As you know REST the communication between client and server is HTTP protocol. I use apache (PHP) web server in the backend to server all REST requests. The question is how to use PHP or whatever (in the web server side) to support this kind of Pub/Sub model. One typical scenario would be:
1) Client subscribes for a change in an object (GET /config/object/?type=async) 2) Client does not block with this request as it is async call. 3) Server accept the subscription and waits for the event. 4) Server publishes the client with the required data as and when the event happens.
I basically need to know how to implement all of these four steps above.