scala-java8-compat icon indicating copy to clipboard operation
scala-java8-compat copied to clipboard

Documentation for Future.toJava is stricter than implemented functionality

Open jypma opened this issue 9 years ago • 1 comments

It says here that the CompletionStage returned by FutureConverters doesn't support the toCompletableFuture() interface at all. However, it can be used fine to retrieve the value of a completed future, and/or wait for it. That functionality is currently used by e.g. akka.

The documentation could probably be extended to reflect that waiting / getting is fine, but completing is not.

jypma avatar Jan 28 '16 09:01 jypma

Actually, if the behaviour is indeed correct, it might even make sense to upgrade the return type to either CompletableFuture , or to a sub-interface of CompletionStage that happens to have the CompletableFuture methods that are supported.

jypma avatar Jan 28 '16 10:01 jypma