Package com.ultikits.ultitools.websocket
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 TypeMethodDescriptionintGets the current attempt count.longGets the delay in milliseconds before the next reconnection attempt.voidreset()Resets the strategy state (called on successful connection).booleanChecks 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
-