A11 TypeScript API - v0.2.1
    Preparing search index...

    Class Session

    Connection-scoped runtime that turns wire traffic into agent work.

    A session owns a shared NodeMap, optional ActionRegistry, one or more WireStreams, and every action running across them. Incoming WireMessages are split into action calls and node fragments; bounded, per-stream pumps preserve backpressure while handlers run asynchronously. Outgoing messages may target a stream explicitly or use round-robin routing.

    The session starts open. halfClose stops new sends/actions and asks every transport to drain normally. abort cancels actions and carries a structured failure to peers. The promise returned by done resolves only after all attached stream state has been removed; isClosed() can therefore become true before isDone().

    Hierarchy (View Summary)

    Index
    • Parameters

      • nested: boolean
      • Optionalsignal: AbortSignal

      Returns Promise<Status>

    • Await all actions observed during the wait and aggregate their failures.

      Parameters

      • OptionaltimeoutMs: number

      Returns Promise<Status>

    • Request cooperative cancellation of one active action.

      Parameters

      • actionId: string

      Returns Status

    • Begin clean shutdown and half-close every active stream with OK trailers. Existing inbound work may still arrive and attached streams must still finish before done resolves.

      Returns Status

    • Whether either endpoint has ended the session for new work.

      Returns boolean

    • Whether every attached stream has completed and state is fully quiescent.

      Returns boolean

    • Parameters

      • nested: boolean

      Returns void

    • Replace the registry and rebind active actions for later name resolution. Prefer configuring it before dispatch so one operation does not observe registrations from different registry versions.

      Parameters

      Returns Status

    • Replace the node map and rebind active actions. Existing fragments remain in the old map, so prefer configuring this before traffic starts rather than splitting a live action's state.

      Parameters

      Returns Status