A throwing runnable, a non-returning callable.
Project is divided into API (interfaces only),
io.ayte.utility.task:api
, and implementations,
io.ayte.utility.task:kit
.
Both artifacts have same module names, io.ayte.utility.task.api
and
io.ayte.utility.task.kit
.
The project itself is part of Ayte utility library collection.
This project contains two interfaces (and related infrastructure) for
two interfaces, io.ayte.utility.task.api.Task
and
io.ayte.utility.task.api.AsyncTask
. Task is a Supplier counterpart
between runnable and callable: it doesn't return value, but it may throw
an exception, so it has signature of
interface Task<E extends Throwable> {
void execute() throws E;
}
AsyncTask transfers this contract onto returned CompletableFuture, thus being non-generic (since it can pass exception by other means):
interface AsyncTask {
CompletableFuture<Void> execute();
}
Project is split into two artifacts: io.ayte.utility.task:api
contains just interfaces, while io.ayte.utility.task:kit
contains
both API dependency and helper classes (Tasks
and AsyncTasks
).
Project is fully java 8-compatible, exposing io.ayte.utility.task.api
and io.ayte.utility.task.kit
modules.
If you're looking for functions that may throw, then you probably want to look into io.ayte.utility.action repository.
MIT & UPL-1.0
Ayte Labs, 2019
Do whatever you want.