Class ExponentialBackoffReconnectStrategy

java.lang.Object
cn.com.anysdk.redis.reconnect.ExponentialBackoffReconnectStrategy
All Implemented Interfaces:
RedisReconnectStrategy

public class ExponentialBackoffReconnectStrategy extends Object implements RedisReconnectStrategy
指数退避重连策略 每次重试的等待时间会按指数增长,直到达到最大等待时间
  • Constructor Details

    • ExponentialBackoffReconnectStrategy

      public ExponentialBackoffReconnectStrategy(long initialIntervalMs, long maxIntervalMs, double multiplier, int maxRetryCount)
      创建指数退避重连策略
      Parameters:
      initialIntervalMs - 初始等待时间(毫秒)
      maxIntervalMs - 最大等待时间(毫秒)
      multiplier - 等待时间增长倍数
      maxRetryCount - 最大重试次数,-1表示无限重试
  • Method Details