Interface ReconnectionStrategy
public interface ReconnectionStrategy
Interface that defines a reconnection strategy.
A reconnection strategy will be applied when the session enters the
RECOVERING_RECONNECT
state, allowing the session to attempt to reconnect and
recover its previous state.
- Since:
- 5.5
- Author:
- DiffusionData Limited
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A single reconnection attempt that can either be started or aborted. -
Method Summary
Modifier and TypeMethodDescriptionvoid
performReconnection
(ReconnectionStrategy.ReconnectionAttempt reconnection) This method is called before each reconnection attempt.
-
Method Details
-
performReconnection
This method is called before each reconnection attempt. The strategy should either allow the reconnection attempt to proceed by callingReconnectionStrategy.ReconnectionAttempt.start()
, or abort the reconnection by callingReconnectionStrategy.ReconnectionAttempt.abort()
.Strategies should avoid blocking operations. The
ReconnectionStrategy.ReconnectionAttempt
object can be called either directly or asynchronously (for example, by a scheduled timer) depending on the strategy.- Parameters:
reconnection
- A single reconnection attempt that may be either started or aborted
-