Interface Executor

  • All Implemented Interfaces:

    
    public interface Executor
    
                        

    Manage async tasks.

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

    • Method Detail

      • executeBlocking

         abstract Unit executeBlocking(Duration delay, Function0<Unit> runnable)

        Execute a task to another thread.

        Parameters:
        runnable - the task to run
      • executeBlocking

         abstract Unit executeBlocking(Function0<Unit> runnable)

        Execute a task to another thread.

        Parameters:
        runnable - the task to run
      • executeBlocking

         abstract <T extends Any> Unit executeBlocking(Callable<T> blocking, Function1<T, Unit> result)

        Execute a task to another thread. If an exception is thrown by the blocking function, null is passed to the result function.

        Parameters:
        blocking - the task to run
        result - the result handler
      • setPeriodic

         Long setPeriodic(Duration delay, Function0<Unit> runnable)

        Execute a periodic task.

        Parameters:
        delay - the delay between each other call
        runnable - the task to run
      • setPeriodic

         abstract Long setPeriodic(Duration initialDelay, Duration delay, Function0<Unit> runnable)

        Execute a periodic task.

        Parameters:
        initialDelay - the delay before first call
        delay - the delay between each other call
        runnable - the task to run