title: Spring Async Task returning Future
body: <p>I am developing a Service that calls multiple external services that are independent of each other. I collate the responses of all these services and return it as a consolidated response. Since these are not interdependent , I am using Spring's @Async capability to perform all these activities in parallel. I am following the example provided in this link</p>
  
  <blockquote>
    <p><a href="https://spring.io/guides/gs/async-method/" rel="nofollow">https://spring.io/guides/gs/async-method/</a></p>
  </blockquote>
  
  <p>Here , a while loop is used to wait until all the responses are obtained -</p>
  
  <pre><code>    while (!(page1.isDone() &amp;&amp; page2.isDone() &amp;&amp; page3.isDone())) {
          Thread.sleep(10); //10-millisecond pause between each check
      }
  </code></pre>
  
  <p>I know this a sample code which was aimed at explaining the concept, which it does effectively. However in an enterprise application , can a while loop be used similar to what is shown above or should a different approach be adopted? If a different approach has to be adopted what is the advantage of the approach over using a while loop?</p>