streaming
Streaming timeout policy and idle-timeout stream wrapper.
StreamingPolicy is unconditional (compiled for WASM + native).
IdleTimeoutStream is native-only — requires tokio timers.
Constants
Section titled “Constants”RPC_REQUEST_TIMEOUT
Section titled “RPC_REQUEST_TIMEOUT”const RPC_REQUEST_TIMEOUT: Duration = ;Per-request RPC timeout (wall-clock). Applied to non-streaming calls.
Structs
Section titled “Structs”StreamingPolicy
Section titled “StreamingPolicy”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
| Field | Type | Description |
|---|---|---|
connect_ms | u64 | TCP + TLS handshake timeout. Default: 10s. |
first_byte_ms | u64 | Time until first data chunk arrives (after headers). Default: 45s. |
idle_ms | u64 | Max silence between consecutive chunks — resets on each chunk. Default: 90s. |
Methods
connect_timeout
Section titled “connect_timeout”fn connect_timeout(&self) -> Durationfirst_byte_timeout
Section titled “first_byte_timeout”fn first_byte_timeout(&self) -> Durationidle_timeout
Section titled “idle_timeout”fn idle_timeout(&self) -> DurationIdleTimeoutStream
Section titled “IdleTimeoutStream”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