List of usage examples for io.vertx.core.shareddata AsyncMap putIfAbsent
Future<@Nullable V> putIfAbsent(K k, V v, long ttl);
From source file:io.github.jdocker.serviceregistry.ServiceRegistry.java
License:Apache License
private void putToClusteredMap(Endpoint endpoin, SharedData sd) { sd.<String, String>getClusterWideMap(REG_NAME, res -> { if (res.succeeded()) { AsyncMap<String, String> map = res.result(); map.putIfAbsent(endpoin.getServiceName(), Json.encode(endpoin), result -> { if (result.succeeded()) { } else { // Something went wrong! }// w w w.jav a2s .com }); } else { // Something went wrong! } }); }