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:
- creates the session;
- reconnects a dropped connection;
- closes the session on
shutdown.
§Parallel runs
ManagedParallelSession::start_with_params returns when every child is attached. If one
child fails, it closes the attached children and returns the error.
§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, unlessdisconnect_timeout_secsis 0. - The control channel reconnects. You see no gap in responses.
- If the session has ended, the client stops with
ManagedSessionError::ControlFailed. - A subscription reconnects 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: see the error table in the crate docs.
Re-exports§
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: one session for each part of the split range.
- Parallel
SubSession - One session of a parallel run, driven like a
ManagedBacktestSessionwith a subset of its methods:subscribe_transactions,subscribe_account_diffs,subscribe_actions,next_event,send_continue,rpcandshutdown. - 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
Failure - Why a managed connection gave up.
- Connection
Status - State of one managed connection: the session control channel or a subscription.
- Control
Event - An event from the session control channel. Responses to reattach and close never arrive here.
- 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.