Package org.apache.pekko.dispatch
Class Futures
java.lang.Object
org.apache.pekko.dispatch.Futures
Deprecated.
Futures is the Java API for Futures and Promises
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CompletionStage<T>asJava(scala.concurrent.Future<T> future) Deprecated.Use scala.jdk.javaapi.FutureConverters.asJava instead.static <T> scala.concurrent.Future<T>Deprecated.Use CompletableFuture.failedFuture instead.static <T> CompletionStage<T>Deprecated.Use CompletableFuture.failedStage instead.static <T> scala.concurrent.Future<T>Deprecated.Use CompletableFuture.supplyAsync instead.static <T> scala.concurrent.Promise<T>promise()Deprecated.Use new CompletableFuture instead.static <T> scala.concurrent.Future<T>successful(T result) Deprecated.Use CompletableFuture.completedFuture instead.
-
Constructor Details
-
Futures
public Futures()Deprecated.
-
-
Method Details
-
asJava
Deprecated.Use scala.jdk.javaapi.FutureConverters.asJava instead. Since 2.0.0.Convert a Scala Future to a Java CompletionStage.- Since:
- 1.2.0
-
future
public static <T> scala.concurrent.Future<T> future(Callable<T> body, scala.concurrent.ExecutionContext executor) Deprecated.Use CompletableFuture.supplyAsync instead. Since 2.0.0.Starts an asynchronous computation and returns aFutureobject with the result of that computation.The result becomes available once the asynchronous computation is completed.
- Parameters:
body- the asynchronous computationexecutor- the execution context on which the future is run- Returns:
- the
Futureholding the result of the computation
-
promise
public static <T> scala.concurrent.Promise<T> promise()Deprecated.Use new CompletableFuture instead. Since 2.0.0.Creates a promise object which can be completed with a value.- Returns:
- the newly created
Promiseobject
-
failed
Deprecated.Use CompletableFuture.failedFuture instead. Since 2.0.0.creates an already completed Promise with the specified exception -
successful
public static <T> scala.concurrent.Future<T> successful(T result) Deprecated.Use CompletableFuture.completedFuture instead. Since 2.0.0.Creates an already completed Promise with the specified result -
failedCompletionStage
Deprecated.Use CompletableFuture.failedStage instead. Since 2.0.0.Creates an already completed CompletionStage with the specified exception
-
CompletionStagesand standardjava.util.concurrent.CompletableFutureAPIs instead.