Class RateLimitingEventAggregator<E>
java.lang.Object
com.pnfsoftware.jeb.util.concurrent.RateLimitingEventAggregator<E>
- Type Parameters:
E- event type
A rate-limiting event aggregator that buffers and forwards events to a destination target.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for the actual target for events. -
Constructor Summary
ConstructorsConstructorDescriptionRateLimitingEventAggregator(RateLimitingEventAggregator.IEventTarget<E> target, long periodMs) -
Method Summary
-
Constructor Details
-
RateLimitingEventAggregator
public RateLimitingEventAggregator(RateLimitingEventAggregator.IEventTarget<E> target, long periodMs) - Parameters:
target- actual target for the eventsperiodMs- the minimal time between two events to avoid buffering, in ms; setting this value to zero or negative effectively disables rate limiting (i.e. events are always passed to the target as they arrive)
-
-
Method Details
-
send
- Parameters:
e- a non-null event object- Returns:
- a hint: if true, the event was passed to the target; else, it was buffered and will be passed at a later time
-