Interface ReconnectStrategy

All Known Implementing Classes:
ExponentialBackoffStrategy

public interface ReconnectStrategy
Strategy interface for WebSocket reconnection behavior.
Since:
6.2.0
Version:
1.0.0
Author:
wisdomme
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the current attempt count.
    long
    Gets the delay in milliseconds before the next reconnection attempt.
    void
    Resets the strategy state (called on successful connection).
    boolean
    Checks if reconnection should continue.
  • Method Details

    • getNextDelay

      long getNextDelay()
      Gets the delay in milliseconds before the next reconnection attempt.
      Returns:
      the delay in milliseconds
    • reset

      void reset()
      Resets the strategy state (called on successful connection).
    • getAttemptCount

      int getAttemptCount()
      Gets the current attempt count.
      Returns:
      the number of attempts made
    • shouldContinue

      boolean shouldContinue()
      Checks if reconnection should continue.
      Returns:
      true if more reconnection attempts should be made