Class TaskSchedulerHelper

  • All Implemented Interfaces:

    
    public class TaskSchedulerHelper
    
                        
    Since:

    2022-12-05

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static ThreadPoolTaskScheduler Light(boolean nonnull)
      static ThreadPoolTaskScheduler Heavy(boolean nonnull) see NamingSlardarConst#slardarHeavyScheduler
      static ThreadPoolTaskScheduler referScheduler(boolean fast) Get Light Scheduler if fast, otherwise Heavy.
      static void execute(boolean fast, @NotNull() Runnable task) Execute an async task immediately, `fast` means that the task will be finished soon, e.g.
      static ScheduledFuture<out Object> execute(boolean fast, long delayMs, @NotNull() Runnable task) Execute an async task after delayMs millis (ThreadNow), `fast` means that the task will be finished soon, e.g.
      static ScheduledFuture<out Object> execute(boolean fast, Instant start, @NotNull() Runnable task) Execute an async task at specified instant, `fast` means that the task will be finished soon, e.g.
      static ScheduledFuture<out Object> execute(boolean fast, Trigger trigger, @NotNull() Runnable task) Execute an async task by given trigger, `fast` means that the task will be finished soon, e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • Light

        @Contract(value = "true->!null") static ThreadPoolTaskScheduler Light(boolean nonnull)
      • Heavy

        @Contract(value = "true->!null") static ThreadPoolTaskScheduler Heavy(boolean nonnull)

        see NamingSlardarConst#slardarHeavyScheduler

      • referScheduler

        @NotNull() static ThreadPoolTaskScheduler referScheduler(boolean fast)

        Get Light Scheduler if fast, otherwise Heavy.

      • execute

         static void execute(boolean fast, @NotNull() Runnable task)

        Execute an async task immediately, `fast` means that the task will be finished soon, e.g. 10s.

      • execute

         static ScheduledFuture<out Object> execute(boolean fast, long delayMs, @NotNull() Runnable task)

        Execute an async task after delayMs millis (ThreadNow), `fast` means that the task will be finished soon, e.g. 10s.

      • execute

         static ScheduledFuture<out Object> execute(boolean fast, Instant start, @NotNull() Runnable task)

        Execute an async task at specified instant, `fast` means that the task will be finished soon, e.g. 10s.

      • execute

         static ScheduledFuture<out Object> execute(boolean fast, Trigger trigger, @NotNull() Runnable task)

        Execute an async task by given trigger, `fast` means that the task will be finished soon, e.g. 10s. Note, errorHandler, unlike other methods, does not handle DelegatingErrorHandlingRunnable.