T
- result type@Deprecated @FunctionalInterface public interface Task<T>
A Task
is a function that takes an instance of Task.Complete
and returns nothing.
Complete
is a handler that needs to be actively called to complete the Task
.
Callable<T> worker = ...;
Future<T> result = Future.run(complete -> complete.with(Try.of(worker::call)));
Modifier and Type | Interface and Description |
---|---|
static interface |
Task.Complete<T>
Deprecated.
Completes a task.
|
Modifier and Type | Method and Description |
---|---|
void |
run(Task.Complete<T> complete)
Deprecated.
Runs the task.
|
void run(Task.Complete<T> complete) throws Throwable
Future
.complete
- a function that completes this taskThrowable
- if an error occursCopyright © 2021. All Rights Reserved.