Example usage for io.vertx.core.shareddata SharedData getCounter

List of usage examples for io.vertx.core.shareddata SharedData getCounter

Introduction

In this page you can find the example usage for io.vertx.core.shareddata SharedData getCounter.

Prototype

void getCounter(String name, Handler<AsyncResult<Counter>> resultHandler);

Source Link

Document

Get an asynchronous counter.

Usage

From source file:examples.SharedDataExamples.java

License:Open Source License

public void example7(SharedData sd) {
    sd.getCounter("mycounter", res -> {
        if (res.succeeded()) {
            Counter counter = res.result();
        } else {//from w  w w.j ava  2  s  .  c o  m
            // Something went wrong!
        }
    });
}