Class ClosingFuture.Combiner

java.lang.Object
com.google.common.util.concurrent.ClosingFuture.Combiner
Direct Known Subclasses:
ClosingFuture.Combiner2, ClosingFuture.Combiner3, ClosingFuture.Combiner4, ClosingFuture.Combiner5
Enclosing class:
ClosingFuture<V extends @Nullable Object>

@DoNotMock("Use ClosingFuture.whenAllSucceed() or .whenAllComplete() instead.") public static class ClosingFuture.Combiner extends Object
A builder of a ClosingFuture step that is derived from more than one input step.

See ClosingFuture.whenAllComplete(Iterable) and ClosingFuture.whenAllSucceed(Iterable) for how to instantiate this class.

Example:


 final ClosingFuture<BufferedReader> file1ReaderFuture = ...;
 final ClosingFuture<BufferedReader> file2ReaderFuture = ...;
 ListenableFuture<Integer> numberOfDifferentLines =
       ClosingFuture.whenAllSucceed(file1ReaderFuture, file2ReaderFuture)
           .call(
               (closer, peeker) -> {
                 BufferedReader file1Reader = peeker.getDone(file1ReaderFuture);
                 BufferedReader file2Reader = peeker.getDone(file2ReaderFuture);
                 return countDifferentLines(file1Reader, file2Reader);
               },
               executor)
           .closing(executor);
 
Since:
30.0