Class AtlasFutures


  • public final class AtlasFutures
    extends Object
    • Method Detail

      • allOptionalsAsMap

        public static <T,​R> com.google.common.util.concurrent.ListenableFuture<Map<T,​R>> allOptionalsAsMap​(Map<T,​com.google.common.util.concurrent.ListenableFuture<Optional<R>>> inputToListenableFutureMap,
                                                                                                                       Executor executor)
        Creates a new ListenableFuture whose value is a map containing the values of all its input futures, if all succeed. Input key-value pairs for which the input futures resolve to Optional.empty() are filtered out.
        Type Parameters:
        T - type of query input
        R - type of query result
        Parameters:
        inputToListenableFutureMap - query input to ListenableFuture of the query result
        Returns:
        ListenableFuture of the combined map
      • allAsMap

        public static <T,​R> com.google.common.util.concurrent.ListenableFuture<Map<T,​R>> allAsMap​(Map<T,​com.google.common.util.concurrent.ListenableFuture<R>> inputToListenableFutureMap,
                                                                                                              Executor executor)
      • getDone

        public static <R> R getDone​(com.google.common.util.concurrent.ListenableFuture<R> resultFuture)
      • getUnchecked

        public static <R> R getUnchecked​(Future<R> future)