You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/rpc.adoc
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ This middleware handles:
111
111
112
112
* Automatic retries for transient HTTP errors (e.g., 5xx server errors, network timeouts) for requests made to the *currently active RPC URL*.
113
113
* An exponential backoff policy between these retry attempts.
114
-
* Parameters like the number of retries, backoff durations, and jitter are defined in an `HttpRetryConfig` struct (see <<Configuration Options>>).
114
+
* Parameters like the number of retries, backoff durations, and jitter are defined in an `RetryConfig` struct (see <<Configuration Options>>).
115
115
* This same-endpoint retry mechanism is independent of, and operates before, the endpoint rotation logic. If all same-endpoint retries fail for the current URL, the error is then processed by the `EndpointManager`.
116
116
117
117
==== Endpoint Rotation (via `EndpointManager`)
@@ -120,26 +120,26 @@ If all same-endpoint retries fail for the currently active RPC URL, or if certai
120
120
121
121
==== Configuration Options
122
122
123
-
The same-endpoint retry behavior is configured via the `HttpRetryConfig` struct, which is used by `create_retryable_http_client` to set up the `ExponentialBackoff` policy for `reqwest-retry`.
123
+
The same-endpoint retry behavior is configured via the `RetryConfig` struct, which is used by `create_retryable_http_client` to set up the `ExponentialBackoff` policy for `reqwest-retry`.
124
124
125
-
The default settings for `HttpRetryConfig` result in an `ExponentialBackoff` policy approximately equivalent to:
125
+
The default settings for `RetryConfig` result in an `ExponentialBackoff` policy approximately equivalent to:
126
126
[source,rust]
127
127
----
128
-
// This illustrates the default policy created by HttpRetryConfig::default()
128
+
// This illustrates the default policy created by RetryConfig::default()
129
129
// and create_retryable_http_client.
130
-
let http_retry_config = HttpRetryConfig::default();
The configurable options are defined in the `HttpRetryConfig` struct:
138
+
The configurable options are defined in the `RetryConfig` struct:
139
139
[source,rust]
140
140
----
141
141
// In utils::http
142
-
pub struct HttpRetryConfig {
142
+
pub struct RetryConfig {
143
143
/// Maximum number of retries for transient errors (after the initial attempt).
144
144
pub max_retries: u32,
145
145
/// Initial backoff duration before the first retry.
@@ -156,7 +156,7 @@ pub struct HttpRetryConfig {
156
156
The client architecture ensures efficient resource use and consistent retry behavior:
157
157
158
158
1. A single base `reqwest::Client` is created by `HttpTransportClient` with optimized connection pool settings. This base client is shared.
159
-
2. The `create_retryable_http_client` utility takes this base client and an `HttpRetryConfig` to produce a `ClientWithMiddleware`.
159
+
2. The `create_retryable_http_client` utility takes this base client and an `RetryConfig` to produce a `ClientWithMiddleware`.
160
160
3. This `ClientWithMiddleware` (the "retryable client") is then used for all HTTP operations within `HttpTransportClient`, including initial health checks, requests sent via `EndpointManager`, and `try_connect` calls during rotation. This ensures all operations benefit from the configured retry policy and the shared connection pool.
161
161
162
162
Each transport client may define its own retry policy:
0 commit comments