Class DelayTask

java.lang.Object
org.opt4j.viewer.DelayTask

public class DelayTask extends Object
The DelayTask executes tasks immediately or delayed if they arrive too close (delay). If they arrive way too close, older tasks will be dropped.
  • Constructor Details

    • DelayTask

      public DelayTask(long delay)
      Constructs a DelayTask.
      Parameters:
      delay - the minimum delay between two tasks
    • DelayTask

      public DelayTask(long delay, int priority)
      Constructs a DelayTask with a given priority.
      Parameters:
      delay - the minimum delay between two tasks
      priority - the priority of the executing thread
  • Method Details

    • execute

      public void execute(Runnable task)
      Executes the task. If tasks arrive to close, some of them are dropped.
      Parameters:
      task - the task to be executed
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable