Skip to content

streaming

Streaming timeout policy and idle-timeout stream wrapper.

StreamingPolicy is unconditional (compiled for WASM + native). IdleTimeoutStream is native-only — requires tokio timers.

const RPC_REQUEST_TIMEOUT: Duration = ;

Per-request RPC timeout (wall-clock). Applied to non-streaming calls.

Three-clock streaming timeout configuration.

Unconditional: compiled for both WASM and native targets. On WASM, values are stored for config parity but not enforced until WASI 0.3 streaming support is available.

Fields

FieldTypeDescription
connect_msu64TCP + TLS handshake timeout. Default: 10s.
first_byte_msu64Time until first data chunk arrives (after headers). Default: 45s.
idle_msu64Max silence between consecutive chunks — resets on each chunk. Default: 90s.

Methods

fn connect_timeout(&self) -> Duration
fn first_byte_timeout(&self) -> Duration
fn idle_timeout(&self) -> Duration

Stream wrapper that terminates when no item arrives within idle_timeout.

The timer resets on every yielded item — a stream emitting one token every 500ms runs indefinitely. A stream that goes silent for idle_timeout is terminated with None (clean EOF).

Methods

fn new(inner: S, idle_timeout: Duration) -> Self