Interface RedisReconnectStrategy

All Known Implementing Classes:
ExponentialBackoffReconnectStrategy, FixedIntervalReconnectStrategy

public interface RedisReconnectStrategy
Redis重连策略接口
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    获取最大重试次数
    获取策略名称
    long
    getNextWaitTime(int retryCount)
    获取下一次重连的等待时间(毫秒)
    void
    重置重连策略状态
  • Method Details

    • getNextWaitTime

      long getNextWaitTime(int retryCount)
      获取下一次重连的等待时间(毫秒)
      Parameters:
      retryCount - 当前重试次数
      Returns:
      等待时间(毫秒)
    • getMaxRetryCount

      int getMaxRetryCount()
      获取最大重试次数
      Returns:
      最大重试次数,-1表示无限重试
    • reset

      void reset()
      重置重连策略状态
    • getName

      String getName()
      获取策略名称
      Returns:
      策略名称