15 std::chrono::milliseconds
max_delay{std::chrono::seconds{10}};
38[[nodiscard]] std::chrono::milliseconds
retry_delay(std::uint8_t attempt,
51 std::string_view body = {})
const override;
56 std::shared_ptr<const HttpTransport> inner_;
Request boundary used by KalshiClient.
Definition http_client.hpp:62
Transport decorator that retries transient failures with exponential backoff.
Definition retry.hpp:46
Result< HttpResponse > request(HttpMethod method, std::string_view path, std::string_view body={}) const override
path is relative to the base URL and may carry a query string.
RetryingTransport(std::shared_ptr< const HttpTransport > inner, RetryPolicy policy={})
const RetryPolicy & policy() const noexcept
Definition retry.hpp:53
bool should_retry(HttpMethod method, const HttpResponse &response, const RetryPolicy &policy) noexcept
std::chrono::milliseconds retry_delay(std::uint8_t attempt, const RetryPolicy &policy)
Backoff before the attempt after attempt (1-based), with jitter applied.
std::expected< T, Error > Result
Result type for SDK operations.
Definition error.hpp:50
HttpMethod
HTTP methods.
Definition http_client.hpp:20
Definition http_client.hpp:36
std::uint8_t max_attempts
Total attempts, including the first.
Definition retry.hpp:20
double jitter_factor
Random spread applied to each delay, as a fraction of it. 0 disables jitter.
Definition retry.hpp:18
bool retry_on_server_error
Definition retry.hpp:23
bool retry_writes
Also retry POST, PUT, and DELETE after network errors and 5xx responses.
Definition retry.hpp:29
std::chrono::milliseconds max_delay
Definition retry.hpp:15
std::chrono::milliseconds initial_delay
Definition retry.hpp:14
bool retry_on_network_error
Definition retry.hpp:21
double backoff_multiplier
Definition retry.hpp:16
bool retry_on_rate_limit
Definition retry.hpp:22