Class Debouncer

java.lang.Object
org.n52.janmayen.Debouncer

public class Debouncer extends Object
Postpones a operation until a configurable amount of time is passed without further requests for the operation.
Since:
1.0.0
  • Constructor Details

    • Debouncer

      public Debouncer(int interval, Runnable runnable)
      Creates a new Debouncer.
      Parameters:
      interval - the interval to wait for new calls.
      runnable - the task to execute
  • Method Details

    • call

      public void call()
      Request the execution of the operation.
    • finish

      public void finish()
      Shut this Debouncer down by executing any pending request. Note: further calls to this class are undefined.