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(com.aol.cyclops.internal.react.async.future.FastFuture<T> t) |
void |
block(java.util.function.Function<com.aol.cyclops.internal.react.async.future.FastFuture<T>,T> safeJoin) |
java.util.Collection<com.aol.cyclops.internal.react.async.future.FastFuture<T>> |
getAllResults() |
java.util.Collection<com.aol.cyclops.internal.react.async.future.FastFuture<T>> |
getResults() |
LazyResultConsumer<T> |
withResults(java.util.Collection<com.aol.cyclops.internal.react.async.future.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(com.aol.cyclops.internal.react.async.future.FastFuture<T> t)
accept
in interface java.util.function.Consumer<com.aol.cyclops.internal.react.async.future.FastFuture<T>>
public void block(java.util.function.Function<com.aol.cyclops.internal.react.async.future.FastFuture<T>,T> safeJoin)
block
in interface LazyResultConsumer<T>
public LazyResultConsumer<T> withResults(java.util.Collection<com.aol.cyclops.internal.react.async.future.FastFuture<T>> t)
LazyResultConsumer
withResults
in interface LazyResultConsumer<T>
t
- Collection to be populatedpublic java.util.Collection<com.aol.cyclops.internal.react.async.future.FastFuture<T>> getResults()
getResults
in interface LazyResultConsumer<T>
public java.util.Collection<com.aol.cyclops.internal.react.async.future.FastFuture<T>> getAllResults()
getAllResults
in interface LazyResultConsumer<T>