Skip to main content

Module managed

Module managed 

Source
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

Re-exports§

pub use control::ControlEvent;
pub use subscription::SubscriptionHandle;
pub use subscription::SubscriptionNotification;

Structs§

ManagedBacktestSession
A session that reconnects on its own.
ManagedParallelSession
A parallel run: the server splits the requested slot range across concurrent sessions, all driven over one session control channel.
ParallelSubSession
One session of a parallel run. Drive it like a ManagedBacktestSession: the same ManagedEvents, in the same order, and the same ManagedSessionErrors.
SessionInfo
What the server reported when it created the session.
StartSessionParams
Parameters shared by ManagedBacktestSession and ManagedParallelSession startup.
StartSessionParamsBuilder
Use builder syntax to set the inputs and finish with build().
SubscriptionDiagnostics
Subscription diagnostics counters, shared across every subscription manager a run spawns.
SubscriptionHandle
Handle to a running subscription manager task. Managed sessions keep these internally; you read their notifications through next_event.

Enums§

ConnectionStatus
State of one managed connection: the session control channel or a subscription.
ControlEvent
An event from the session control channel. ManagedEvent wraps each one in the variant of the same name; see it for the ordering contract.
CreateError
Why start could not create a managed session; carried by ManagedSessionError::Create.
ManagedEvent
An event from a managed session, returned by next_event.
ManagedSessionError
Why a managed session call failed.
SubscriptionNotification
One notification from a managed subscription. ManagedEvent wraps 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_secs unset.
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 becomes ConnectionStatus::Failed.