Expand description
Connection-managed wrappers over the backtest WebSocket protocol.
Most callers should use ManagedBacktestSession. It owns the control and
subscription manager tasks, waits for session creation, gates Continue
sends on live connections, and provides one shutdown path.
The control and subscription WebSockets are each owned by a dedicated task that handles its own lifecycle: connect, handshake, keepalive, reconnect. Workload code interacts via channels and a status watcher, never with the WebSocket directly.
Structs§
- Control
Handle - Handle to a running
ControlManagertask. - Managed
Backtest Session - High-level managed backtest session.
- Session
Info - Identity of a created backtest session.
- Subscription
Handle - Handle to a running subscription manager task.
Enums§
- Connection
Status - Connection state as observed from outside the manager task.
- Control
Event - Events the driver observes from the control connection.
- Managed
Event - Managed
Session Error - Error returned by the high-level managed session wrapper.
- Subscription
Notification
Constants§
- CONNECT_
TIMEOUT - Timeout for the initial WebSocket connect (TCP + TLS + HTTP upgrade).
- GRACEFUL_
CLOSE_ TIMEOUT - Timeout for the graceful close handshake at end-of-session.
- HANDSHAKE_
RESPONSE_ TIMEOUT - Timeout for any single response during a handshake (Create, Attach, Resume, subscribe ack). Does not apply to per-message reads during an established session — those are bounded by ping/pong liveness instead.
- KEEPALIVE_
INTERVAL - How often to send a WebSocket ping during an established connection.
- KEEPALIVE_
MISS_ DEADLINE - How long without inbound traffic before declaring the connection dead. Roughly three missed pings.
- RECONNECT_
BACKOFF_ MULTIPLIER - RECONNECT_
INITIAL_ BACKOFF - RECONNECT_
JITTER - RECONNECT_
MAX_ ATTEMPTS - RECONNECT_
MAX_ BACKOFF - RECONNECT_
MAX_ TOTAL - RECONNECT_
UPTIME_ RESET - A connection that stays
Upfor this long resets the reconnect counter.
Functions§
- spawn_
account_ diff_ subscription_ manager - spawn_
control_ manager - Spawn a
ControlManagertask and return a handle. - spawn_
transaction_ subscription_ manager