Interface TinyTaskService

  • All Implemented Interfaces:

    
    public interface TinyTaskService
    
                        
    Task based on ThreadPoolTaskScheduler and Database.
    `execute` is only for execution, not involve notice or databases
    `schedule` auto trigger notice and database, task is managed by id
    
    Since:

    2022-11-29

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class TinyTaskService.Task
    • 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
      abstract ThreadPoolTaskScheduler referScheduler(boolean fast) Get the internal ThreadPoolTaskScheduler
      ScheduledExecutorService referExecutor(boolean fast) Get the internal ScheduledExecutorService
      void execute(boolean fast, @NotNull() Runnable task) Async execute a task immediately.
      ScheduledFuture<out Object> execute(boolean fast, long delayMs, @NotNull() Runnable task) Async execute a task after `delayMs` millis (ThreadNow).
      ScheduledFuture<out Object> execute(boolean fast, Instant startTime, @NotNull() Runnable task) Async execute a task at specified time (`fastTime` without timezone), `fast` means a lightweight that executes quickly and completes within seconds.
      ScheduledFuture<out Object> execute(boolean fast, Trigger trigger, @NotNull() Runnable task) Async execute a task by specified trigger, `fast` means a lightweight that executes quickly and completes within seconds.
      abstract Set<TinyTaskService.Task> schedule(@NotNull() Object taskerBean) Take all the methods annotated with TinyTask inside the taskerBean, initialize them as tasks, and execute them.
      abstract TinyTaskService.Task schedule(@NotNull() Object taskerBean, @NotNull() Method taskerCall, @Nullable() Object taskerPara) Take all the methods annotated with TinyTask inside the taskerBean, initialize them as tasks, and execute them.
      TinyTaskService.Task schedule(@NotNull() Lam.Ref lambdaRefer, @Nullable() Object taskerPara) Take all the methods annotated with TinyTask inside the taskerBean, initialize them as tasks, and execute them.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • referScheduler

        @NotNull() abstract ThreadPoolTaskScheduler referScheduler(boolean fast)

        Get the internal ThreadPoolTaskScheduler

      • execute

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

        Async execute a task immediately. `fast` means a lightweight that executes quickly and completes within seconds.

      • execute

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

        Async execute a task after `delayMs` millis (ThreadNow). `fast` means a lightweight that executes quickly and completes within seconds.

      • execute

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

        Async execute a task at specified time (`fastTime` without timezone), `fast` means a lightweight that executes quickly and completes within seconds.

      • execute

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

        Async execute a task by specified trigger, `fast` means a lightweight that executes quickly and completes within seconds. The `errorHandler` is different from other methods and does not recognize `DelegatingErrorHandlingRunnable`.

      • schedule

        @NotNull() abstract Set<TinyTaskService.Task> schedule(@NotNull() Object taskerBean)

        Take all the methods annotated with TinyTask inside the taskerBean, initialize them as tasks, and execute them.

      • schedule

         abstract TinyTaskService.Task schedule(@NotNull() Object taskerBean, @NotNull() Method taskerCall, @Nullable() Object taskerPara)

        Take all the methods annotated with TinyTask inside the taskerBean, initialize them as tasks, and execute them. taskId == `-1` means not start

      • schedule

         TinyTaskService.Task schedule(@NotNull() Lam.Ref lambdaRefer, @Nullable() Object taskerPara)

        Take all the methods annotated with TinyTask inside the taskerBean, initialize them as tasks, and execute them. taskId == `-1` means not start, `lambdaRefer` is lambda ref, get by `Lam.ref(taskerBean::method)`