title: how to make my method wait untill promise completes
body: <p>I have a method (in play framework) from which i will call i will call a webservice but in play 2.4.0M2 version the response i am getting is wrapped in a promise.</p>
  
  <p>So the method return back to do it's normal work without waiting for the webservice to complete.That makes some issues to mu previous flow.So now i have to make the method wait on same line where i am calling the webservice and continue to execute from next line once the webservice returns some response.</p>
  
  <p>Is there any way to do it.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>Promise&lt;WSResponse&gt; response = WS.url(SignConstants.SIGN_DOCUMENT_URL).post(new File(inputfilepath));
  
  return response.map(new Function&lt;WSResponse, Boolean&gt;() {
     public Boolean apply(WSResponse response) throws Exception {
        //some code here 
        return Boolean.TRUE;
    }
  });
  </code></pre>