iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iceberg::RetryRunner< RetryPolicy > Class Template Reference

Utility class for running tasks with retry logic. More...

#include <retry_util.h>

Inheritance diagram for iceberg::RetryRunner< RetryPolicy >:
iceberg::detail::RetryRunnerBase

Public Member Functions

 RetryRunner (RetryConfig config={})
 Construct a RetryRunner with the given configuration.
 
template<detail::RetryTask F>
auto Run (F &&task, int32_t *attempt_counter=nullptr) -> std::remove_cvref_t< std::invoke_result_t< F & > >
 Run a task that returns a Result<T>
 

Detailed Description

template<retry::Policy RetryPolicy>
class iceberg::RetryRunner< RetryPolicy >

Utility class for running tasks with retry logic.

When retries are enabled (num_retries > 0), RetryPolicy must be an enabled policy such as retry::OnlyRetryOn<...> or retry::StopRetryOn<...>.

Member Function Documentation

◆ Run()

template<retry::Policy RetryPolicy>
template<detail::RetryTask F>
auto iceberg::RetryRunner< RetryPolicy >::Run ( F &&  task,
int32_t *  attempt_counter = nullptr 
) -> std::remove_cvref_t<std::invoke_result_t<F&>>
inline

Run a task that returns a Result<T>

When num_retries > 0, RetryPolicy must allow retrying matching errors.

TODO: Replace attempt_counter with a metrics reporter once it is available.


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