Java Code Examples for org.redisson.config.MasterSlaveServersConfig#getRetryAttempts()
The following examples show how to use
org.redisson.config.MasterSlaveServersConfig#getRetryAttempts() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedissonPatternTopic.java From redisson with Apache License 2.0 | 5 votes |
protected void acquire(AsyncSemaphore semaphore) { MasterSlaveServersConfig config = commandExecutor.getConnectionManager().getConfig(); int timeout = config.getTimeout() + config.getRetryInterval() * config.getRetryAttempts(); if (!semaphore.tryAcquire(timeout)) { throw new RedisTimeoutException("Remove listeners operation timeout: (" + timeout + "ms) for " + name + " topic"); } }
Example 2
Source File: CommandAsyncService.java From redisson with Apache License 2.0 | 5 votes |
@Override public void syncSubscription(RFuture<?> future) { MasterSlaveServersConfig config = connectionManager.getConfig(); try { int timeout = config.getTimeout() + config.getRetryInterval() * config.getRetryAttempts(); if (!future.await(timeout)) { ((RPromise<?>) future).tryFailure(new RedisTimeoutException("Subscribe timeout: (" + timeout + "ms). Increase 'subscriptionsPerConnection' and/or 'subscriptionConnectionPoolSize' parameters.")); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } future.syncUninterruptibly(); }
Example 3
Source File: CommandAsyncService.java From redisson with Apache License 2.0 | 5 votes |
@Override public void syncSubscriptionInterrupted(RFuture<?> future) throws InterruptedException { MasterSlaveServersConfig config = connectionManager.getConfig(); int timeout = config.getTimeout() + config.getRetryInterval() * config.getRetryAttempts(); if (!future.await(timeout)) { ((RPromise<?>) future).tryFailure(new RedisTimeoutException("Subscribe timeout: (" + timeout + "ms). Increase 'subscriptionsPerConnection' and/or 'subscriptionConnectionPoolSize' parameters.")); } future.sync(); }
Example 4
Source File: RedissonTopic.java From redisson with Apache License 2.0 | 5 votes |
protected void acquire(AsyncSemaphore semaphore) { MasterSlaveServersConfig config = commandExecutor.getConnectionManager().getConfig(); int timeout = config.getTimeout() + config.getRetryInterval() * config.getRetryAttempts(); if (!semaphore.tryAcquire(timeout)) { throw new RedisTimeoutException("Remove listeners operation timeout: (" + timeout + "ms) for " + name + " topic"); } }