Package org.ores.async
Interface Asyncc.Task<T>
- All Superinterfaces:
Asyncc.AsyncTask<T,Throwable>
- Enclosing class:
- Asyncc
Throwable-fixed shorthand for
AsyncTask<T, Throwable>.
Java doesn't support default generic parameters, but the error type in this library is
almost always Throwable. This shorthand lets you drop the redundant
, Throwable from explicitly-typed task references:
// before:
final var classifyTasks = items.stream()
.<Asyncc.AsyncTask<Result, Throwable>>map(it -> c -> { ... })
.toList();
// after (v0.2.8+):
final var classifyTasks = items.stream()
.<Asyncc.Task<Result>>map(it -> c -> { ... })
.toList();
Task<T> is a strict subtype of AsyncTask<T, Throwable>, so anywhere the
latter is expected, the former is accepted — including the List-taking
Parallel,
ParallelLimit, and
Series combinators, whose List parameters were
widened to List<? extends AsyncTask<T, E>> in v0.2.8 to make
List<Task<T>> flow in cleanly.
- Since:
- 0.2.8
-
Method Summary
Methods inherited from interface org.ores.async.Asyncc.AsyncTask
run