Example usage for io.vertx.core CompositeFuture any

List of usage examples for io.vertx.core CompositeFuture any

Introduction

In this page you can find the example usage for io.vertx.core CompositeFuture any.

Prototype

static <T1, T2> CompositeFuture any(Future<T1> f1, Future<T2> f2) 

Source Link

Document

Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.

Usage

From source file:examples.CoreExamples.java

License:Open Source License

public void exampleFutureAny1(Future<String> future1, Future<String> future2) {
    CompositeFuture.any(future1, future2).setHandler(ar -> {
        if (ar.succeeded()) {
            // At least one is succeeded
        } else {//from   w  ww .jav a  2  s.  c o m
            // All failed
        }
    });
}