Skip to main content

Module streams

Module streams 

Source
Expand description

WHATWG ReadableStream — a deliberately small spec subset (the full llrt/stream-web machinery — BYOB, byte controllers, tee — is studied for behaviour only, not ported).

Two body sources behind one class:

  • Buffered: new ReadableStream({ start(controller) }) and Blob.stream() — chunks held in memory.
  • Net: Response.body — pulls chunks directly off the live reqwest response (ferridriver::http_client::HttpStreamResponse) on each read(), so a large/streamed body is NOT fully buffered; the consumer’s pull rate is the backpressure.

getReader() (locks; second getReader -> TypeError), read() ({value:Uint8Array,done}), releaseLock(), cancel(), locked, async iteration. Reader/controller are not user-constructible (throw, per spec) but the global names + instanceof exist. read() is async (a Net pull awaits the socket). Subset: no pull/tee/BYOB underlying-source callbacks.

Structs§

ReadableStreamDefaultControllerJs
ReadableStreamDefaultReaderJs
ReadableStreamJs