title: completion of functions annoted with @Async
body: <p>I am calling an async function from a spring-mvc controller.</p>
  
  <pre><code>@Async
  public void doSomething()
  {
      ....
  }
  </code></pre>
  
  <p>I am simply calling this function from a controller method</p>
  
  <pre><code>@RequestMapping(/person)
  @ResponseBody Person returnPerson()
  {
      service.doSomething();
  }
  </code></pre>
  
  <p>The function returnPerson returns as expected. However I would like to return  <code>DeferredResult</code> to denote the completion of returnPerson.</p>
  
  <pre><code>@RequestMapping(/person)
  @ResponseBody DeferredResult&lt;Person&gt; returnPerson()
  {
      service.doSomething();
  }
  </code></pre>
  
  <p>I think for that to happen I should know when deSomething has finished its execution so that I can return the response to the caller. I am not getting how do I know when doSomething has finished its execution and then how do I return <code>DeferredResult</code> based in that?</p>