|
Entropic 2.3.8
Local-first agentic inference engine
|
Exponential backoff with jitter for reconnection attempts. More...
#include <entropic/mcp/reconnect_policy.h>
Public Member Functions | |
| ReconnectPolicy (uint32_t base_delay_ms=1000, uint32_t max_delay_ms=60000, uint32_t max_retries=5, double backoff_factor=2.0) | |
| Construct with explicit parameters. | |
| ReconnectPolicy (const ReconnectConfig &config) | |
| Construct from config struct. | |
| uint32_t | delay_ms (uint32_t attempt) const |
| Compute delay for the given attempt number. | |
| bool | exhausted (uint32_t attempt) const |
| Check if retries are exhausted. | |
Exponential backoff with jitter for reconnection attempts.
delay(n) = min(base * factor^n, max) + jitter(0, delay*0.1)
Definition at line 27 of file reconnect_policy.h.
| entropic::ReconnectPolicy::ReconnectPolicy | ( | uint32_t | base_delay_ms = 1000, |
| uint32_t | max_delay_ms = 60000, |
||
| uint32_t | max_retries = 5, |
||
| double | backoff_factor = 2.0 |
||
| ) |
Construct with explicit parameters.
| base_delay_ms | Base delay in milliseconds. |
| max_delay_ms | Maximum delay cap. |
| max_retries | Maximum attempts (0 = infinite). |
| backoff_factor | Multiplicative factor per attempt. |
| base_delay_ms | Base delay. |
| max_delay_ms | Maximum delay cap. |
| max_retries | Maximum attempts (0 = infinite). |
| backoff_factor | Exponential multiplier. |
Definition at line 25 of file reconnect_policy.cpp.
|
explicit |
Construct from config struct.
| config | ReconnectConfig with all parameters. |
| config | ReconnectConfig. |
Definition at line 41 of file reconnect_policy.cpp.
| uint32_t entropic::ReconnectPolicy::delay_ms | ( | uint32_t | attempt | ) | const |
Compute delay for the given attempt number.
Compute delay with exponential backoff and jitter.
| attempt | Zero-based attempt number. |
| attempt | Zero-based attempt number. |
Definition at line 54 of file reconnect_policy.cpp.
| bool entropic::ReconnectPolicy::exhausted | ( | uint32_t | attempt | ) | const |
Check if retries are exhausted.
| attempt | Zero-based attempt number. |
| attempt | Zero-based attempt number. |
Definition at line 74 of file reconnect_policy.cpp.