interface
DirectUnderlyingSource
interface DirectUnderlyingSource<R = any>
- pull: (controller: ReadableStreamDirectController) => void | PromiseLike<void>
Write the stream's data with
controller.write()(await it for backpressure) and finish withcontroller.close().A destination that takes the whole body (
Bun.serve,Bun.write,.text(), ...) callspull()once. If it returns a promise, the stream stays open while it is pending, ends when it resolves, and errors if it rejects. If it returns synchronously without closing, the stream stays open untilcontroller.close()is called.A reader (
getReader(),for await,pipeTo()) callspull()again for a later read, once the previous call has settled.