What a connector does with a countdown switch, the same for every venue that has one (Binance USDⓈ-M countdownCancelAll, OKX cancel-all-after).
More...
|
| | CountdownDriver ()=default |
| |
| | CountdownDriver (std::int64_t window_ms, std::int64_t refresh_numerator=1, std::int64_t refresh_denominator=3) noexcept |
| |
| bool | enabled () const noexcept |
| |
| std::int64_t | window_ms () const noexcept |
| |
| bool | lapsed () const noexcept |
| |
| bool | ever_armed () const noexcept |
| |
| const CountdownSwitch & | clock () const noexcept |
| |
| Step | poll (std::int64_t now_ns) noexcept |
| | From the housekeeping timer. Lapsed is returned once per session.
|
| |
| std::uint32_t | begin_round (std::int64_t now_ns, std::uint32_t parts) noexcept |
| | A refresh round of parts requests starts now; the token goes with each part's reply.
|
| |
| void | went_out () noexcept |
| |
| void | confirmed (std::uint32_t round) noexcept |
| | The venue confirmed one part of round round.
|
| |
| bool | needs_stop () const noexcept |
| | Whether the shutdown has to stop the venue's countdown.
|
| |
| void | reset () noexcept |
| | The session ended (after the stop): the next connect starts from scratch.
|
| |
What a connector does with a countdown switch, the same for every venue that has one (Binance USDⓈ-M countdownCancelAll, OKX cancel-all-after).
The connector sends the requests; this decides when, and what a lapse means.
Refresh A refresh is a round of parts requests (one per symbol on USDⓈ-M, where the countdown is per symbol; one on OKX, where it is per account). The switch counts as pushed out only when every part of the round is confirmed, from the time the round went out: the venue's timer starts when it receives the request, which is after that, so the lapse is never declared later than the venue acts. A symbol whose refresh fails is a symbol whose countdown still runs from the last round. Lapse The window ran out since the last confirmed round: the venue has cancelled our orders, or is about to. poll reports it once; the connector kills the venue (the engine must not put back quotes the venue just pulled). No refresh goes out after that: whatever the local cancels do, the venue's own timer is left to run out, so the account ends flat by the venue's hand even when the lapse was only lost replies. A reconnect (reset) starts afresh. Stop At a requested shutdown the connector cancels its own orders, and the countdown is stopped rather than left against an account nobody quotes. Needed once any refresh went out, confirmed or not: a request whose reply was lost may have armed it.