kalshi-cpp 0.6.2
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
kalshi::RetryPolicy Struct Reference

#include <kalshi/retry.hpp>

Public Attributes

std::chrono::milliseconds initial_delay {100}
 
std::chrono::milliseconds max_delay {std::chrono::seconds{10}}
 
double backoff_multiplier {2.0}
 
double jitter_factor {0.1}
 Random spread applied to each delay, as a fraction of it. 0 disables jitter.
 
std::uint8_t max_attempts {3}
 Total attempts, including the first.
 
bool retry_on_network_error {true}
 
bool retry_on_rate_limit {true}
 
bool retry_on_server_error {true}
 
bool retry_writes {false}
 Also retry POST, PUT, and DELETE after network errors and 5xx responses.
 

Member Data Documentation

◆ initial_delay

std::chrono::milliseconds kalshi::RetryPolicy::initial_delay {100}

◆ max_delay

std::chrono::milliseconds kalshi::RetryPolicy::max_delay {std::chrono::seconds{10}}

◆ backoff_multiplier

double kalshi::RetryPolicy::backoff_multiplier {2.0}

◆ jitter_factor

double kalshi::RetryPolicy::jitter_factor {0.1}

Random spread applied to each delay, as a fraction of it. 0 disables jitter.

◆ max_attempts

std::uint8_t kalshi::RetryPolicy::max_attempts {3}

Total attempts, including the first.

◆ retry_on_network_error

bool kalshi::RetryPolicy::retry_on_network_error {true}

◆ retry_on_rate_limit

bool kalshi::RetryPolicy::retry_on_rate_limit {true}

◆ retry_on_server_error

bool kalshi::RetryPolicy::retry_on_server_error {true}

◆ retry_writes

bool kalshi::RetryPolicy::retry_writes {false}

Also retry POST, PUT, and DELETE after network errors and 5xx responses.

Off by default: the first attempt may have taken effect (an order placed, a quote accepted, an order canceled), and a repeat would then double it or fail misleadingly. A 429 always retries because the server rejected the request without acting on it.


The documentation for this struct was generated from the following file: