Class Futures$

java.lang.Object
org.apache.pekko.dispatch.Futures$

public class Futures$ extends Object
Deprecated.
Use CompletionStages and standard java.util.concurrent.CompletableFuture APIs instead.
Futures is the Java API for Futures and Promises

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Futures$
    Deprecated.
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    asJava(scala.concurrent.Future<T> future)
    Deprecated.
    Use scala.jdk.javaapi.FutureConverters.asJava instead.
    <T> scala.concurrent.Future<T>
    failed(Throwable exception)
    Deprecated.
    Use CompletableFuture.failedFuture instead.
    Deprecated.
    Use CompletableFuture.failedStage instead.
    <T> scala.concurrent.Future<T>
    future(Callable<T> body, scala.concurrent.ExecutionContext executor)
    Deprecated.
    Use CompletableFuture.supplyAsync instead.
    <T> scala.concurrent.Promise<T>
    Deprecated.
    Use new CompletableFuture instead.
    <T> scala.concurrent.Future<T>
    successful(T result)
    Deprecated.
    Use CompletableFuture.completedFuture instead.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MODULE$

      public static final Futures$ MODULE$
      Deprecated.
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • Futures$

      public Futures$()
      Deprecated.
  • Method Details

    • asJava

      public <T> CompletionStage<T> asJava(scala.concurrent.Future<T> future)
      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 a Future object with the result of that computation.

      The result becomes available once the asynchronous computation is completed.

      Parameters:
      body - the asynchronous computation
      executor - the execution context on which the future is run
      Returns:
      the Future holding 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 Promise object
    • failed

      public <T> scala.concurrent.Future<T> failed(Throwable exception)
      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

      public <T> CompletionStage<T> failedCompletionStage(Throwable ex)
      Deprecated.
      Use CompletableFuture.failedStage instead. Since 2.0.0.
      Creates an already completed CompletionStage with the specified exception