Package net.bluemind.lib.vertx.utils
Class Debouncer<P>
java.lang.Object
net.bluemind.lib.vertx.utils.Debouncer<P>
Block calls to the given 
BiConsumer in a debounce way. Allow
 the last call to be executed after a grace period (interval). Each
 call is identified using KEY. Only calls sharing the same
 identity block each others. Thread safe.- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
Debouncer- Parameters:
- consumer- the code to execute in a debounce way
- interval- the debounce grace period in milliseconds
- noDebounceFirst- the very first call (per key) will not suffer the grace period. It violates the real debounce pattern but may be useful in some cases.
 
 
- 
- 
Method Details- 
callRequest a call toconsumer, based on the givenkey. The actual execution of the code depends on the debounce grace period: if no call with that key has been done withinintervalmilliseconds then execute the last call.
 
-