com.hazelcast.util.scheduler

## Class CoalescingDelayedTrigger

- java.lang.Object
- - com.hazelcast.util.scheduler.CoalescingDelayedTrigger

-     public class CoalescingDelayedTrigger
      extends Object

  Coalescing trigger can be used when you want coalesce multiple execution of `Runnable`. 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 `executeWithDelay()`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CoalescingDelayedTrigger(ExecutionService executionService, long delay, long maxDelay, Runnable runnable)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `executeWithDelay()` invoke delayed execution.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CoalescingDelayedTrigger

          public CoalescingDelayedTrigger(ExecutionService executionService,
                                          long delay,
                                          long maxDelay,
                                          Runnable runnable)

      Parameters:
        `executionService` -
        `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

  - ### Method Detail

    - #### executeWithDelay

          public void executeWithDelay()

      invoke delayed execution.

Copyright © 2019. All rights reserved.