Class 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 Detail

      • 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 Detail

      • 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