S - the source type being collected.T - the target type, the collected sources are being transformed into.public class CollectHelper<S,T> extends Object implements FutureDone<S>
TinyAsync.collect(Collection, Collector)
The helper implements FutureDone, and is intended to be used by binding it as a listener
to the futures being collected.
This is a lock-free implementation capable of writing the results out of order.
| Modifier and Type | Field and Description |
|---|---|
static byte |
CANCELLED |
static byte |
FAILED |
static byte |
RESOLVED |
| Constructor and Description |
|---|
CollectHelper(int size,
Collector<S,T> collector,
Collection<? extends AsyncFuture<?>> sources,
ResolvableFuture<? super T> target) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelled() |
void |
failed(Throwable e) |
void |
resolved(S result) |
public static final byte RESOLVED
public static final byte FAILED
public static final byte CANCELLED
public CollectHelper(int size,
Collector<S,T> collector,
Collection<? extends AsyncFuture<?>> sources,
ResolvableFuture<? super T> target)
public void resolved(S result) throws Exception
resolved in interface FutureDone<S>Exceptionpublic void failed(Throwable e) throws Exception
failed in interface FutureDone<S>Exceptionpublic void cancelled()
throws Exception
cancelled in interface FutureDone<S>ExceptionCopyright © 2017. All rights reserved.