Class Futures

java.lang.Object
io.stargate.sgv2.api.common.futures.Futures

public class Futures extends Object
  • Constructor Details

    • Futures

      public Futures()
  • Method Details

    • getUninterruptibly

      public static <T> T getUninterruptibly(CompletionStage<T> stage)
      Gets a future without reacting to interruptions: if the current thread is interrupted, the operation continues until the future completes, and the thread will be re-interrupted upon completion.

      If the future fails with an unchecked exception, it will be rethrown as-is. If it fails with a checked exception, it will be wrapped in an UncheckedExecutionException.

    • failedFuture

      public static <T> CompletableFuture<T> failedFuture(Exception e)
    • sequence

      public static <T> CompletionStage<List<T>> sequence(List<CompletionStage<T>> futures)
      Returns a future of all the results, or a failed future if any of the inputs fails.