|
| | CountdownSwitch ()=default |
| |
| | CountdownSwitch (std::int64_t window_ms, std::int64_t refresh_numerator=1, std::int64_t refresh_denominator=3) noexcept |
| | window_ms is what the venue is told; 0 disables the switch.
|
| |
| bool | enabled () const noexcept |
| |
| std::int64_t | window_ms () const noexcept |
| |
| std::int64_t | refresh_period_ns () const noexcept |
| |
| bool | due (std::int64_t now_ns) const noexcept |
| | True when a refresh has to go out now.
|
| |
| void | attempted (std::int64_t now_ns) noexcept |
| | A refresh was written to the venue.
|
| |
| void | armed (std::int64_t now_ns) noexcept |
| | The venue accepted the refresh: the countdown is running from here.
|
| |
| bool | expired (std::int64_t now_ns) const noexcept |
| | The window has run out since the last refresh the venue confirmed: it has cancelled our orders, or is about to.
|
| |
| bool | ever_armed () const noexcept |
| |
| void | disarm () noexcept |
| | The session ended, or the kill already fired: the next due() starts from scratch.
|
| |
Refresh clock for a countdown dead man's switch.
Holds no venue detail: the connector asks due() from its housekeeping timer, sends its own request, reports attempted(), and reports armed() when the venue answers.
The two clocks are separate on purpose. attempted paces retries, so a refresh that never reaches the venue is tried again next period instead of every tick. armed is what the window is measured from, so a request that goes out and comes back an error does not pretend the countdown was pushed out. If this process is what broke, neither clock moves, the venue's countdown runs out and it cancels — which is the point.
| bool fastmm::venues::CountdownSwitch::expired |
( |
std::int64_t |
now_ns | ) |
const |
|
inlinenoexcept |
The window has run out since the last refresh the venue confirmed: it has cancelled our orders, or is about to.
This process is still alive (it is asking), so something between it and the venue is broken. It must not simply put back the quotes the venue just pulled — that is a quoter racing a kill switch it cannot see. A switch that was up and has lapsed is a kill. One that was never up is not: the connector is loud about those failures instead, because a venue that refuses the request outright must not stop the session dead.