title: Best way to create REST API for long lasting tasks?
body: <p>Suppose I have 2 servers. </p>
  
  <p>The first is a service that provides some computations, which can last long time (minutes to hours).</p>
  
  <p>The second server will use this service to have some data computed.</p>
  
  <p>I'm trying to design a REST API for the first server and so far so good. But I'd like to hear some opinion on how to model notifications when the long lasting task is finished.</p>
  
  <p>I considered 2 approaches so far:</p>
  
  <ol>
  <li>Polling - the second server will ask every now and then about the result.</li>
  <li>Callback - Second server will setup an uri for the first one to call after it is done. But this smells a bit in REST API. </li>
  </ol>
  
  <p>What do you think?</p>