Class EventScheduler

java.lang.Object
com.realtime.crossfire.jxclient.items.EventScheduler

public class EventScheduler extends 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 Details

    • EventScheduler

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

    • start

      public void start()
      Activates this instance.
    • trigger

      public void trigger()
      Notifies the callback.