Class CScheduler


  • public final class CScheduler
    extends Object
    This class provides asynchronous and delayed task scheduling, based setTimeout java script method.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • get

        public static CScheduler get()
        Returns the instance of singleton.
        Returns:
        the instance of singleton
      • submit

        public CSchedulerRegistration submit​(Runnable task)
        Schedules immediately a task, without any delay.
        Parameters:
        task - the command to execute
        Returns:
        the task scheduling registration for canceling, if needed
      • submit

        public CSchedulerRegistration submit​(Runnable task,
                                             int delay)
        Schedules a task with a constant delay.
        Parameters:
        task - the command to execute
        delay - the amount of time to wait after one invocation ends before the next invocation
        Returns:
        the task scheduling registration for canceling, if needed