I have a Java Future
object which I would like to convert into a Scala Future
.
Looking at the j.u.c.Future
API, there is nothing much that I could use other than the isDone
method. Is this isDone
method blocking?
Currently this is what I have in my mind:
val p = Promise()
if (javaFuture.isDone())
p.success(javaFuture.get)
Is there a better way to do this?