-
public interface ExecutorManage async tasks.
-
-
Method Summary
Modifier and Type Method Description abstract UnitexecuteBlocking(Duration delay, Function0<Unit> runnable)Execute a task to another thread. abstract UnitexecuteBlocking(Function0<Unit> runnable)Execute a task to another thread. abstract <T extends Any> UnitexecuteBlocking(Callable<T> blocking, Function1<T, Unit> result)Execute a task to another thread. LongsetPeriodic(Duration delay, Function0<Unit> runnable)Execute a periodic task. abstract LongsetPeriodic(Duration initialDelay, Duration delay, Function0<Unit> runnable)Execute a periodic task. -
-
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 runresult- the result handler
-
setPeriodic
Long setPeriodic(Duration delay, Function0<Unit> runnable)
Execute a periodic task.
- Parameters:
delay- the delay between each other callrunnable- 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 calldelay- the delay between each other callrunnable- the task to run
-
-
-
-