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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> CompletionStage<T>asJava(scala.concurrent.Future<T> future) Deprecated.Use scala.jdk.javaapi.FutureConverters.asJava instead.<T> scala.concurrent.Future<T>Deprecated.Use CompletableFuture.failedFuture instead.<T> CompletionStage<T>Deprecated.Use CompletableFuture.failedStage instead.<T> scala.concurrent.Future<T>Deprecated.Use CompletableFuture.supplyAsync instead.<T> scala.concurrent.Promise<T>promise()Deprecated.Use new CompletableFuture instead.<T> scala.concurrent.Future<T>successful(T result) Deprecated.Use CompletableFuture.completedFuture instead.
-
Field Details
-
MODULE$
Deprecated.Static reference to the singleton instance of this Scala object.
-
-
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 <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 <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 <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.