Search in sources :

Example 6 with MasterSlaveServersConfig

use of org.redisson.config.MasterSlaveServersConfig in project redisson by redisson.

the class CommandAsyncService method syncSubscription.

@Override
public void syncSubscription(RFuture<?> future) {
    MasterSlaveServersConfig config = connectionManager.getConfig();
    try {
        int timeout = config.getTimeout() + config.getRetryInterval() * config.getRetryAttempts();
        if (!future.await(timeout)) {
            throw new RedisTimeoutException("Subscribe timeout: (" + timeout + "ms)");
        }
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
    }
    future.syncUninterruptibly();
}
Also used : RedisTimeoutException(org.redisson.client.RedisTimeoutException) MasterSlaveServersConfig(org.redisson.config.MasterSlaveServersConfig)

Aggregations

MasterSlaveServersConfig (org.redisson.config.MasterSlaveServersConfig)6 BaseMasterSlaveServersConfig (org.redisson.config.BaseMasterSlaveServersConfig)3 Future (io.netty.util.concurrent.Future)1 FutureListener (io.netty.util.concurrent.FutureListener)1 ScheduledFuture (io.netty.util.concurrent.ScheduledFuture)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 RFuture (org.redisson.api.RFuture)1 RedisConnection (org.redisson.client.RedisConnection)1 RedisConnectionException (org.redisson.client.RedisConnectionException)1 RedisException (org.redisson.client.RedisException)1 RedisTimeoutException (org.redisson.client.RedisTimeoutException)1 MasterSlaveEntry (org.redisson.connection.MasterSlaveEntry)1 SingleEntry (org.redisson.connection.SingleEntry)1