title: REST Server to client communication
body: <p>I'm developing a Java API for an Adndroid app in Spring. Right now my API is 100% REST and stateless. For the client to receive data, it must send a request first.</p>
  
  <p>However, what I need is the <strong>server to send data to the to the client</strong> /not the client to the server fisrt/ whenever it is ready with it's task.</p>
  
  <p>I think that some kind of session must be created between the two parties. </p>
  
  <p>My question is: How can I achieve this functionality of the SERVER sending data to the CLIENT when it's ready with it's task? /It is unknown how long the task will take./</p>
  
  <p>What kind of API should I develop for this purpose?</p>
  
  <p><em>One idiotic workaround is sending a request to the server every n seconds but I'm seeking for a more intelligent approach.</em>  </p>