public class ThrottlingAggregator<T>
extends java.lang.Object
Delivery happens when either of the following occur:
| Modifier and Type | Class and Description |
|---|---|
static interface |
ThrottlingAggregator.Callback<T> |
| Constructor and Description |
|---|
ThrottlingAggregator(long delay,
long maxFrequency,
ThrottlingAggregator.Callback<T> callback)
Create a
ThrottlingAggregator with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
void |
processItem(T item) |
public ThrottlingAggregator(long delay,
long maxFrequency,
ThrottlingAggregator.Callback<T> callback)
ThrottlingAggregator with the given parameters.delay - How long to wait for another call to processItem before attempting delivery. During this
delay is where aggregation happens.maxFrequency - The maximum frequency at which aggregated items should be delivered.callback - A callback that aggregated items will be delivered to.public void processItem(T item)