Interface Scheduler

    • Method Detail

      • run

        default Task run​(Runnable runnable)
        Run a task now
        Parameters:
        runnable - the task
        Returns:
        the warped task
      • run

        Task run​(Runnable runnable,
                 java.time.Duration delay)
        Run a task later
        Parameters:
        runnable - the task
        delay - the delay
        Returns:
        the warped task
      • runTimer

        Task runTimer​(Runnable runnable,
                      java.time.Duration delay,
                      java.time.Duration period)
        Run a task timer
        Parameters:
        runnable - the task
        delay - the delay
        period - the period
        Returns:
        the warped task
      • submit

        default <V> Callback<V> submit​(Callable<V> callable)
        Submit a task now
        Type Parameters:
        V - the return type
        Parameters:
        callable - the task
        Returns:
        the warped task
      • submit

        <V> Callback<V> submit​(Callable<V> callable,
                               java.time.Duration delay)
        Submit a task later
        Type Parameters:
        V - the return type
        Parameters:
        callable - the task
        delay - the delay
        Returns:
        the warped task
      • cancelAll

        void cancelAll()
        Cancel all the tasks
      • getName

        String getName()
        Get the name of the scheduler
        Returns:
        the name of the scheduler
      • getPlugin

        Plugin getPlugin()
        Get the plugin
        Returns:
        the plugin
      • close

        void close()
        Close this scheduler
      • isClosed

        boolean isClosed()
        Indicate whether this scheduler is closed or not
        Returns:
        true if this scheduler is closed, false otherwise
      • closeNow

        void closeNow()
        Close this scheduler even if there are tasks running