Skip to main content

run_session

Function run_session 

Source
pub async fn run_session<C, D>(
    conn: Box<dyn Connection>,
    codec: &C,
    dispatch: &D,
    config: &SessionConfig,
)
where C: EnvelopeCodec + ?Sized, D: Dispatch + ?Sized,
Expand description

Drive one accepted Connection until it closes.

Authenticates once, then interleaves (biased toward inbound reads, so a chatty subscription cannot starve the RPC path) incoming requests, outgoing subscription events, and reaping of finished subscription pumps. Dropping the engine cancels every live subscription.