By Clement Escoffier
Sorry, there is no free lunch—distributed applications are complex. You can embrace any trends such as microservices, but developing a distributed application is a challenge. Why? Distributed systems have many reasons to fail: technically they’re complicated, and the theory behind distributed systems is also complicated. Vert.x is a toolkit for building reactive distributed applications on top of the Java Virtual Machine in Java, JavaScript, Groovy, Ruby, or Ceylon. Vert.x does not hide the complexity of distributed applications; it lets you manage it. Vert.x applications are able to manage failures, can use several protocols and interaction styles, can handle heavy loads, and can cope with most of the requirements of modern applications.
14. ASYNCHRONOUS & NON-BLOCKING
// Synchronous development model
X x = doSomething(a, b);
// Asynchronous development model - callback variant
doSomething(a, b, // Params
ar -> { // Last param is a Handler<AsyncResult<X>>
// Result handler
});
// Asynchronous development model - future variant
Future<X> future = doSomething(a, b);
future.setHandler(
ar -> { /* Completion handler */ });