Skip to main content

Module managed

Module managed 

Source
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§

ControlHandle
Handle to a running ControlManager task.
ManagedBacktestSession
High-level managed backtest session.
SessionInfo
Identity of a created backtest session.
SubscriptionHandle
Handle to a running subscription manager task.

Enums§

ConnectionStatus
Connection state as observed from outside the manager task.
ControlEvent
Events the driver observes from the control connection.
ManagedEvent
ManagedSessionError
Error returned by the high-level managed session wrapper.
SubscriptionNotification

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 Up for this long resets the reconnect counter.

Functions§

spawn_account_diff_subscription_manager
spawn_control_manager
Spawn a ControlManager task and return a handle.
spawn_transaction_subscription_manager