|
Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
|
Health checking and reconnecting for a ConnectionPool. More...
#include <ConnectionPool.hpp>
Public Attributes | |
| std::function< bool(ClientType &)> | health_check |
| std::chrono::milliseconds | initial_backoff {100} |
| std::chrono::milliseconds | max_backoff {30000} |
| std::function< void(std::chrono::milliseconds, std::function< void()>)> | schedule |
Health checking and reconnecting for a ConnectionPool.
With a health check, a client found unusable (when acquired or released) is dropped and a replacement is connected in the background; failed attempts are retried with exponential backoff, from initial_backoff doubling up to max_backoff.
| std::function<bool(ClientType&)> orbit::database::PoolOptions< ClientType >::health_check |
True if a client is usable, e.g. [](auto& c) { return c.is_healthy(); }. Empty: clients are never checked or replaced.
| std::chrono::milliseconds orbit::database::PoolOptions< ClientType >::initial_backoff {100} |
| std::chrono::milliseconds orbit::database::PoolOptions< ClientType >::max_backoff {30000} |
| std::function<void(std::chrono::milliseconds, std::function<void()>)> orbit::database::PoolOptions< ClientType >::schedule |
Runs a task after a delay (the backoff). The default sleeps on a detached thread; pass one backed by your event loop's timers instead.