FutureConverters
This object contains methods that convert between Scala scala.concurrent.Future and Java java.util.concurrent.CompletionStage.
The explicit conversion methods defined here are intended to be used in Java code. For Scala code, it is recommended to use the extension methods defined in scala.jdk.FutureConverters.
Note that the bridge is implemented at the read-only side of asynchronous handles, namely scala.concurrent.Future (instead of scala.concurrent.Promise) and java.util.concurrent.CompletionStage (instead of java.util.concurrent.CompletableFuture). This is intentional, as the semantics of bridging the write-handles would be prone to race conditions; if both ends (CompletableFuture
and Promise
) are completed independently at the same time, they may contain different values afterwards. For this reason, toCompletableFuture
is not supported on the created CompletionStage
s.
Attributes
- Source
- FutureConverters.scala
- Graph
-
- Supertypes
- Self type
-
FutureConverters.type