public class CoalescingDelayedTrigger extends Object
Once you call the
executeWithDelay() it will wait specified amount of time before actually executing
the Runnable. If
executeWithDelay() is invoked again within the interval then the Runnable will
be executed only once.
It also guarantees no execution will be delayed more than specified maximum delay.
This class is not thread-safe and external synchronization must be ensured when multiple
threads are calling
|Constructor and Description
public CoalescingDelayedTrigger(ExecutionService executionService, long delay, long maxDelay, Runnable runnable)
delay - execution delay in ms
maxDelay - maximum delay in ms. No action will be delayed more specified number of ms.
runnable - action to be executed
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.