The libdispatch style API for Java and Scala