List of usage examples for io.netty.resolver AddressResolverGroup getResolver
public AddressResolver<T> getResolver(final EventExecutor executor)
From source file:org.redisson.connection.DNSMonitor.java
License:Apache License
public DNSMonitor(ConnectionManager connectionManager, RedisClient masterHost, Collection<RedisURI> slaveHosts, long dnsMonitoringInterval, AddressResolverGroup<InetSocketAddress> resolverGroup) { this.resolver = resolverGroup.getResolver(connectionManager.getGroup().next()); masterHost.resolveAddr().syncUninterruptibly(); masters.put(masterHost.getConfig().getAddress(), masterHost.getAddr()); for (RedisURI host : slaveHosts) { Future<InetSocketAddress> resolveFuture = resolver .resolve(InetSocketAddress.createUnresolved(host.getHost(), host.getPort())); resolveFuture.syncUninterruptibly(); slaves.put(host, resolveFuture.getNow()); }/*from ww w . jav a 2 s . c o m*/ this.connectionManager = connectionManager; this.dnsMonitoringInterval = dnsMonitoringInterval; }