Class Futures.FutureCombiner<V extends @Nullable Object>

    • Method Detail

      • callAsync

        public <C extends @Nullable ObjectListenableFuture<C> callAsync​(AsyncCallable<C> combiner,
                                                                          Executor executor)
        Creates the ListenableFuture which will return the result of calling AsyncCallable.call() in combiner when all futures complete, using the specified executor.

        If the combiner throws a CancellationException, the returned future will be cancelled.

        If the combiner throws an ExecutionException, the cause of the thrown ExecutionException will be extracted and returned as the cause of the new ExecutionException that gets thrown by the returned combined future.

        Canceling this future will attempt to cancel all the component futures.

      • call

        @CanIgnoreReturnValue
        public <C extends @Nullable ObjectListenableFuture<C> call​(Callable<C> combiner,
                                                                     Executor executor)
        Creates the ListenableFuture which will return the result of calling Callable.call() in combiner when all futures complete, using the specified executor.

        If the combiner throws a CancellationException, the returned future will be cancelled.

        If the combiner throws an ExecutionException, the cause of the thrown ExecutionException will be extracted and returned as the cause of the new ExecutionException that gets thrown by the returned combined future.

        Canceling this future will attempt to cancel all the component futures.

      • run

        public ListenableFuture<?> run​(Runnable combiner,
                                       Executor executor)
        Creates the ListenableFuture which will return the result of running combiner when all Futures complete. combiner will run using executor.

        If the combiner throws a CancellationException, the returned future will be cancelled.

        Canceling this Future will attempt to cancel all the component futures.

        Since:
        23.6