T - Result typepublic class SamplingCollector<T> extends java.lang.Object implements LazyResultConsumer<T>
| Constructor and Description |
|---|
SamplingCollector(int sampleRate,
LazyResultConsumer<T> consumer) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(FastFuture<T> t) |
void |
block(java.util.function.Function<FastFuture<T>,T> safeJoin) |
java.util.Collection<FastFuture<T>> |
getAllResults() |
java.util.Collection<FastFuture<T>> |
getResults() |
LazyResultConsumer<T> |
withResults(java.util.Collection<FastFuture<T>> t)
Used to generate a new instance for result collection - populates the supplied Collection
|
public SamplingCollector(int sampleRate,
LazyResultConsumer<T> consumer)
sampleRate - Modulus of sampleRate will determine result collectionconsumer - SamplingCollector won't actually collect results, it passes control to another consumer when triggered.public void accept(FastFuture<T> t)
accept in interface java.util.function.Consumer<FastFuture<T>>public void block(java.util.function.Function<FastFuture<T>,T> safeJoin)
block in interface LazyResultConsumer<T>public LazyResultConsumer<T> withResults(java.util.Collection<FastFuture<T>> t)
LazyResultConsumerwithResults in interface LazyResultConsumer<T>t - Collection to be populatedpublic java.util.Collection<FastFuture<T>> getResults()
getResults in interface LazyResultConsumer<T>public java.util.Collection<FastFuture<T>> getAllResults()
getAllResults in interface LazyResultConsumer<T>