async-java / async.java

A Java port of the async library for Node.js. This lib is designed to be used with Vert.x and Akka.io.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asyncc.java

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.

Complete Documentation:

https://async-java.github.io/org/ores/async/Asyncc.html#method.summary

Installation with Maven

Simple example:

import org.ores.async.Asyncc;

public void retrieveValue(){
  Asyncc.Parallel(t -> t.done(null,"foo"), (err, results) -> {
    
    
  });  
}

Utility Methods

Links to the documentation

Control Flow

Map/Filter/Reduce/Each

Queue / Priority Queue

Locking

(Because the synchronized keyword blocks).

Improvements and Quality

This library improves upon async.js. For those familiar, this library makes these improvements:

  1. Composability. This is available because Java has method overloading and JS doesn't.

In JS:

With Java:

  1. async.waterfall is considered harmful. We use a ma

  2. We have a shortCircuited boolean available to check if we can end early.

About

A Java port of the async library for Node.js. This lib is designed to be used with Vert.x and Akka.io.


Languages

Language:Java 98.6%Language:Shell 0.8%Language:JavaScript 0.7%