public class ThrottledAccumulatingConsumer extends Object implements Consumer<Long>, Closeable
Consumer<Long> so that multiple consume calls (accept(java.lang.Long)) within a short
period of time are merged into a single later call with the value accumulated up to that point.| Constructor and Description |
|---|
ThrottledAccumulatingConsumer(Consumer<Long> callback)
Wraps a consumer with the delay of 100 ms.
|
ThrottledAccumulatingConsumer(Consumer<Long> consumer,
Duration delayBetweenCallbacks,
Supplier<Instant> getNow) |
Copyright © 2019. All rights reserved.