Expand description
Sessions that reconnect on their own.
Use ManagedBacktestSession for one session, or ManagedParallelSession for a run
the server splits across concurrent sessions. Each one:
- opens the session control channel and returns once the server has created the session;
- opens one WebSocket on the session’s RPC endpoint per
subscribe_*call; - waits until every connection is up before it sends a continue;
- reconnects a dropped connection and reattaches to the session;
- closes the session on
shutdown.
§Connection drops
- A dropped connection is retried with backoff, up to
RECONNECT_MAX_ATTEMPTSattempts withinRECONNECT_MAX_TOTAL. The session keeps running on the server meanwhile. - The session control channel reattaches and the server replays the responses you missed. You see no gap.
- A subscription resumes from the last slot it delivered and sends that slot again: dedupe transactions by signature, and account diffs by (signature, account, slot).
- When the budget runs out, the next continue fails with
ManagedSessionError::ControlFailedorManagedSessionError::SubscriptionFailed. - A rejected API key (HTTP 401 or 403) is never retried:
startfails withManagedSessionError::ApiKeyRejected.
Re-exports§
pub use control::ControlEvent;pub use subscription::SubscriptionHandle;pub use subscription::SubscriptionNotification;
Structs§
- Managed
Backtest Session - A session that reconnects on its own.
- Managed
Parallel Session - A parallel run: the server splits the requested slot range across concurrent sessions, all driven over one session control channel.
- Parallel
SubSession - One session of a parallel run. Drive it like a
ManagedBacktestSession: the sameManagedEvents, in the same order, and the sameManagedSessionErrors. - Session
Info - What the server reported when it created the session.
- Start
Session Params - Parameters shared by
ManagedBacktestSessionandManagedParallelSessionstartup. - Start
Session Params Builder - Use builder syntax to set the inputs and finish with
build(). - Subscription
Diagnostics - Subscription diagnostics counters, shared across every subscription manager a run spawns.
- Subscription
Handle - Handle to a running subscription manager task. Managed sessions keep these internally; you
read their notifications through
next_event.
Enums§
- Connection
Status - State of one managed connection: the session control channel or a subscription.
- Control
Event - An event from the session control channel.
ManagedEventwraps each one in the variant of the same name; see it for the ordering contract. - Create
Error - Why
startcould not create a managed session; carried byManagedSessionError::Create. - Managed
Event - An event from a managed session, returned by
next_event. - Managed
Session Error - Why a managed session call failed.
- Subscription
Notification - One notification from a managed subscription.
ManagedEventwraps each in the variant of the same name.
Constants§
- DEFAULT_
DISCONNECT_ TIMEOUT_ SECS - How long the server keeps a session alive with no client attached, when a single
session’s create leaves
disconnect_timeout_secsunset. - RECONNECT_
MAX_ ATTEMPTS - Attempt budget for retrying one connection. See
RECONNECT_MAX_TOTAL. - RECONNECT_
MAX_ TOTAL - Time budget for retrying one connection. When it, or
RECONNECT_MAX_ATTEMPTS, runs out, the connection becomesConnectionStatus::Failed.