kalshi-cpp 0.6.2
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
kalshi::RetryingTransport Class Referencefinal

Transport decorator that retries transient failures with exponential backoff. More...

#include <kalshi/retry.hpp>

Inheritance diagram for kalshi::RetryingTransport:
kalshi::HttpTransport

Public Member Functions

 RetryingTransport (std::shared_ptr< const HttpTransport > inner, RetryPolicy policy={})
 
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.
 
const RetryPolicy & policy () const noexcept
 
- Public Member Functions inherited from kalshi::HttpTransport
virtual ~HttpTransport ()=default
 
Result< HttpResponse > get (std::string_view path) const
 
Result< HttpResponse > post (std::string_view path, std::string_view body={}) const
 
Result< HttpResponse > put (std::string_view path, std::string_view body={}) const
 
Result< HttpResponse > del (std::string_view path, std::string_view body={}) const
 

Detailed Description

Transport decorator that retries transient failures with exponential backoff.

A Retry-After header lengthens the wait, up to max_delay.

auto http = std::make_shared<kalshi::HttpClient>(signer);
kalshi::KalshiClient client{std::make_shared<kalshi::RetryingTransport>(http)}; 

Constructor & Destructor Documentation

◆ RetryingTransport()

kalshi::RetryingTransport::RetryingTransport ( std::shared_ptr< const HttpTransport >  inner,
RetryPolicy  policy = {} 
)
explicit

Member Function Documentation

◆ request()

Result< HttpResponse > kalshi::RetryingTransport::request ( HttpMethod  method,
std::string_view  path,
std::string_view  body = {} 
) const
overridevirtual

path is relative to the base URL and may carry a query string.

Implements kalshi::HttpTransport.

◆ policy()

const RetryPolicy & kalshi::RetryingTransport::policy ( ) const
inlinenoexcept

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