Class EventScheduler


  • public class EventScheduler
    extends java.lang.Object
    A scheduler for asynchronous event notifications. Notifications are triggered by calling trigger(). Notifications are delivered by calling the event scheduler callback of eventSchedulerCallback. This callback is called delay after the last call to trigger() but not faster than once per eventSchedulerCallback.
    • Constructor Summary

      Constructors 
      Constructor Description
      EventScheduler​(int delay, int afterEventDelay, @NotNull java.lang.Runnable eventSchedulerCallback)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void start()
      Activates this instance.
      void trigger()
      Notifies the callback.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventScheduler

        public EventScheduler​(int delay,
                              int afterEventDelay,
                              @NotNull
                              @NotNull java.lang.Runnable eventSchedulerCallback)
        Creates a new instance.
        Parameters:
        delay - the initial delay
        afterEventDelay - the "after-event" delay
        eventSchedulerCallback - the callback to notify
    • Method Detail

      • start

        public void start()
        Activates this instance.
      • trigger

        public void trigger()
        Notifies the callback.