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.
ManagedParallelSession
High-level managed parallel session: owns the single multiplexed control connection and hands out one ParallelSubSession per server-created sub-session for the driver to run concurrently.
ParallelSubSession
One sub-session of a parallel run. Mirrors the driver-facing surface of super::ManagedBacktestSession: control events arrive over a demuxed channel from the shared control connection, while transactions flow over this sub-session’s own data-plane subscription managers.
ReconnectCoordinator
Coordinates subscription reconnects across a parallel batch sharing one bandwidth-constrained link.
SessionInfo
Identity of a created backtest session.
StreamingGuard
Holds a ReconnectCoordinator’s streaming count for the lifetime of one connection; decrements and wakes parked siblings on drop.
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
Total budget for the graceful close handshake (close request + close frame). A supervisor’s SIGTERM→SIGKILL grace must exceed this or the close is cut short.
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_UNGATED_ATTEMPTS
Reconnect attempts that fire immediately, before the cross-session reconnect gate engages. A transient drop recovers fast; only once these rapid retries are exhausted does a session fall back to waiting for siblings to drain.
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