title: How do I wrap a java.util.concurrent.Future in an Akka Future?
body: <p>In a Play Framework 2.0.1 (Scala) application, we are using a web service client library which returns <code>java.util.concurrent.Future</code> as responses.</p>
  
  <p>Instead of blocking the Play app on the <code>get()</code> call, we'd like to wrap the <code>j.u.c.Future</code> in an <code>akka.dispatch.Future</code>, so that we can easily use the play framework's <code>AsyncResult</code> processing.</p>
  
  <p>Has anyone done this before, or have a library or example code?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong>: The closest thing we've found is this google groups discussion: <a href="https://groups.google.com/forum/#!topic/play-framework/c4DOOtGF50c" rel="noreferrer">https://groups.google.com/forum/#!topic/play-framework/c4DOOtGF50c</a></p>
  
  <blockquote>
    <p>...if all you have is a plain j.u.c.Future the best you can do to create a non blocking solution is to take the j.u.c.Future and a Promise, and give them to some thread running a polling loop that will complete the Promise with the result of the Future when it is done. </p>
  </blockquote>
  
  <p>Does anyone have an example implementation of this?</p>