In my application, I am converting a java.concurrent.future to a Twitter Future like so:
val myTwitterFuture = FuturePool.unboundedPool{ myJavaFuture.get}
Is this the correct way to do so, or is there a preferred method?
In my application, I am converting a java.concurrent.future to a Twitter Future like so:
val myTwitterFuture = FuturePool.unboundedPool{ myJavaFuture.get}
Is this the correct way to do so, or is there a preferred method?
If your Java future is just a
java.util.concurrent.Future
, then what you have is basically the best you can do, because it's a very poor type. If you have ajava.util.concurrent.CompletableFuture
, you basically combine the answers to convert it to ascala.concurrent.Future
and convert Scala future to a Twitter future: