High-quality port of async.js to Java.
Primarily for use with Vert.x.
Uses async primitives (error-first callbacks), for performance and genericism.Adds nice structure to callback-passing-style codebases.
https://async-java.github.io/org/ores/async/Asyncc.html#method.summary
import org.ores.async.Asyncc;
public void retrieveValue(){
Asyncc.Parallel(t -> t.done(null,"foo"), (err, results) -> {
});
}
Links to the documentation
- Series
- Parallel/ParallelLimit
- Waterfall
- Inject - (most recommended)
- Map, MapSeries, MapLimit
- Filter, FilterSeries, FilterLimit
- Reduce / ReduceRight
- Each, EachSeries, EachLimit
(Because the synchronized keyword blocks).
This library improves upon async.js. For those familiar, this library makes these improvements:
- Composability. This is available because Java has method overloading and JS doesn't.
In JS:
With Java:
-
async.waterfall
is considered harmful. We use a ma -
We have a shortCircuited boolean available to check if we can end early.