V1
- the type returned by the first futureV2
- the type returned by the second futureV3
- the type returned by the third futureV4
- the type returned by the fourth futureV5
- the type returned by the fifth futurepublic static final class ClosingFuture.Combiner5<V1,V2,V3,V4,V5> extends ClosingFuture.Combiner
ClosingFuture.Combiner
that lets you use a lambda or method reference to combine five
ClosingFuture
s. Use ClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture,
ClosingFuture, ClosingFuture)
to start this combination.Modifier and Type | Class and Description |
---|---|
static interface |
ClosingFuture.Combiner5.AsyncClosingFunction5<V1,V2,V3,V4,V5,U>
A function that returns a
ClosingFuture when applied to the values of the five
futures passed to ClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture,
ClosingFuture, ClosingFuture) . |
static interface |
ClosingFuture.Combiner5.ClosingFunction5<V1,V2,V3,V4,V5,U>
A function that returns a value when applied to the values of the five futures passed to
ClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture,
ClosingFuture) . |
ClosingFuture.Combiner.AsyncCombiningCallable<V>, ClosingFuture.Combiner.CombiningCallable<V>
inputs
Modifier and Type | Method and Description |
---|---|
<U> ClosingFuture<U> |
call(ClosingFuture.Combiner5.ClosingFunction5<V1,V2,V3,V4,V5,U> function,
Executor executor)
Returns a new
ClosingFuture pipeline step derived from the inputs by applying a
combining function to their values. |
<U> ClosingFuture<U> |
callAsync(ClosingFuture.Combiner5.AsyncClosingFunction5<V1,V2,V3,V4,V5,U> function,
Executor executor)
Returns a new
ClosingFuture pipeline step derived from the inputs by applying a
ClosingFuture -returning function to their values. |
call, callAsync
public <U> ClosingFuture<U> call(ClosingFuture.Combiner5.ClosingFunction5<V1,V2,V3,V4,V5,U> function, Executor executor)
ClosingFuture
pipeline step derived from the inputs by applying a
combining function to their values. The function can use a ClosingFuture.DeferredCloser
to capture
objects to be closed when the pipeline is done.
If this combiner was returned by ClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture,
ClosingFuture, ClosingFuture, ClosingFuture)
and any of the inputs fail, so will the
returned step.
If the function throws a CancellationException
, the pipeline will be cancelled.
If the function throws an ExecutionException
, the cause of the thrown ExecutionException
will be extracted and used as the failure of the derived step.
public <U> ClosingFuture<U> callAsync(ClosingFuture.Combiner5.AsyncClosingFunction5<V1,V2,V3,V4,V5,U> function, Executor executor)
ClosingFuture
pipeline step derived from the inputs by applying a
ClosingFuture
-returning function to their values. The function can use a ClosingFuture.DeferredCloser
to capture objects to be closed when the pipeline is done (other than those
captured by the returned ClosingFuture
).
If this combiner was returned by ClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture,
ClosingFuture, ClosingFuture, ClosingFuture)
and any of the inputs fail, so will the
returned step.
If the function throws a CancellationException
, the pipeline will be cancelled.
If the function throws an ExecutionException
, the cause of the thrown ExecutionException
will be extracted and used as the failure of the derived step.
If the function throws any other exception, it will be used as the failure of the derived step.
If an exception is thrown after the function creates a ClosingFuture
, then none of
the closeable objects in that ClosingFuture
will be closed.
Usage guidelines for this method:
ListenableFuture
or a
ClosingFuture
. If possible, prefer calling ClosingFuture.Combiner.call(CombiningCallable,
Executor)
instead, with a function that returns the next value directly.
closer.eventuallyClose()
for every closeable object this step creates in order to
capture it for later closing.
ClosingFuture
. To turn a ListenableFuture
into a ClosingFuture
call ClosingFuture.from(ListenableFuture)
.
The same warnings about doing heavyweight operations within ClosingFuture.transformAsync(AsyncClosingFunction, Executor)
apply here.
Copyright © 2010–2021. All rights reserved.