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) })andBlob.stream()— chunks held in memory. - Net:
Response.body— pulls chunks directly off the livereqwestresponse (ferridriver::http_client::HttpStreamResponse) on eachread(), 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.