|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
Wraps any TickSource with automatic reconnection on read failure. More...
#include <tick_source.hpp>
Public Member Functions | |
| ReconnectingTickSource (Source source, std::chrono::milliseconds initial_delay=std::chrono::milliseconds{100}, std::chrono::milliseconds max_delay=std::chrono::milliseconds{30 '000}) | |
| std::optional< OHLCVTick > | read () |
| Read the next tick. Returns std::nullopt on transient failure (after sleeping current_delay_). Reconnect is attempted automatically. | |
| void | reset_backoff () noexcept |
| Reset the backoff state without reconnecting the underlying source. | |
| Source & | source () noexcept |
| Access the underlying source (e.g. to re-open a pipe). | |
| const Source & | source () const noexcept |
Wraps any TickSource with automatic reconnection on read failure.
Uses exponential backoff starting at initial_delay (default 100 ms), doubling each attempt up to max_delay (default 30 000 ms = 30 s). After a successful read the delay resets to initial_delay.
Thread safety: same as the wrapped Source type.
Definition at line 295 of file tick_source.hpp.
|
inlineexplicit |
Definition at line 297 of file tick_source.hpp.
|
inline |
Read the next tick. Returns std::nullopt on transient failure (after sleeping current_delay_). Reconnect is attempted automatically.
Definition at line 308 of file tick_source.hpp.
|
inlinenoexcept |
Reset the backoff state without reconnecting the underlying source.
Definition at line 321 of file tick_source.hpp.
|
inlinenoexcept |
Definition at line 325 of file tick_source.hpp.
|
inlinenoexcept |
Access the underlying source (e.g. to re-open a pipe).
Definition at line 324 of file tick_source.hpp.