title: scala.concurrent.Future wrapper for java.util.concurrent.Future
body: <p>I'm using Play Framework 2.1.1 with an external java library that produces a java.util.concurrent.Future result. I'm using the scala future's as opposed to Akka which I think is the right thing to do as of Play 2.1. How can I wrap the java.util.concurrent.Future up into a scala.concurrent.Future while still keeping the code non-blocking?</p>
  
  <pre><code>def geConnection() : Connection = {
    // blocking with get
    connectionPool.getConnectionAsync().get(30000, TimeUnit.MILLISECONDS)
  }
  </code></pre>
  
  <p>The above code returns a connection but uses a get so it becomes blocking</p>
  
  <pre><code>def getConnectionFuture() : Future[Connection] = {
    future {
      // how to remove blocking get and return a scala future?
      connectionPool.getConnectionAsync().get(30000, TimeUnit.MILLISECONDS)
    }
  }
  </code></pre>
  
  <p>Ideally I want a scala function that returns the connection as a future like the code above but without the code blocking via the get. What else do I need to put into the function to make it non blocking.</p>
  
  <p>Any pointers would be great.</p>