List of usage examples for io.netty.util.concurrent Promise syncUninterruptibly
@Override Promise<V> syncUninterruptibly();
From source file:org.redisson.connection.ElasticacheConnectionManager.java
License:Apache License
private RedisConnection connect(ElasticacheServersConfig cfg, URI addr) { RedisConnection connection = nodeConnections.get(addr); if (connection != null) { return connection; }//from w ww. j av a 2 s.c o m RedisClient client = createClient(addr.getHost(), addr.getPort(), cfg.getConnectTimeout()); try { connection = client.connect(); Promise<RedisConnection> future = newPromise(); connectListener.onConnect(future, connection, null, config); future.syncUninterruptibly(); nodeConnections.put(addr, connection); } catch (RedisConnectionException e) { log.warn(e.getMessage(), e); } catch (Exception e) { log.error(e.getMessage(), e); } return connection; }
From source file:org.redisson.connection.RedisClientEntry.java
License:Apache License
private RedisConnection connect() { RedisConnection c = client.connect(); Promise<RedisConnection> future = manager.newPromise(); manager.getConnectListener().onConnect(future, c, null, manager.getConfig()); future.syncUninterruptibly(); return future.getNow(); }