use of org.redisson.pubsub.PublishSubscribeService in project redisson by redisson.
the class MasterSlaveConnectionManager method initTimer.
protected void initTimer(MasterSlaveServersConfig config) {
int[] timeouts = new int[] { config.getRetryInterval(), config.getTimeout() };
Arrays.sort(timeouts);
int minTimeout = timeouts[0];
if (minTimeout % 100 != 0) {
minTimeout = (minTimeout % 100) / 2;
} else if (minTimeout == 100) {
minTimeout = 50;
} else {
minTimeout = 100;
}
timer = new HashedWheelTimer(new DefaultThreadFactory("redisson-timer"), minTimeout, TimeUnit.MILLISECONDS, 1024, false);
connectionWatcher = new IdleConnectionWatcher(this, config);
subscribeService = new PublishSubscribeService(this, config);
}
Aggregations