Example usage for io.vertx.core.logging Logger info

List of usage examples for io.vertx.core.logging Logger info

Introduction

In this page you can find the example usage for io.vertx.core.logging Logger info.

Prototype

@Deprecated
public void info(final Object message, final Throwable t, final Object... objects) 

Source Link

Usage

From source file:space.xkr47.vertx.acme4j.AcmeManager.java

License:Apache License

<T> void fetchWithRetry(Logger logger, Callable<T> blockingHandler, Future<T> done) {
    vertx.executeBlocking((Future<T> fut) -> {
        try {/*from   ww  w  .  j  a  v  a 2 s  . co  m*/
            fut.complete(blockingHandler.call());
        } catch (Exception e) {
            fut.fail(e);
        }
    }, ar -> {
        if (ar.failed() && !(ar.cause() instanceof AcmeRetryAfterException)) {
            done.fail(ar.cause());
            return;
        }
        if (ar.succeeded() && ar.result() != null) {
            done.complete(ar.result());
            return;
        }
        long nextSleep = ar.succeeded() ? 3000
                : ((AcmeRetryAfterException) ar.cause()).getRetryAfter().getTime() - currentTimeMillis();
        logger.info("Recheck in {}ms @ {}", nextSleep, new Date(System.currentTimeMillis() + nextSleep));
        vertx.setTimer(nextSleep, timerId -> fetchWithRetry(logger, blockingHandler, done));
    });
}