interface
ReadableStreamDirectController
interface ReadableStreamDirectController
- @param wait
When
true, the returned promise resolves only once the destination has drained its own internal buffer (i.e. backpressure has cleared). Use this after write returns aPromise. - ): number | Promise<number>;
Write a chunk directly to the destination.
Returns the number of bytes written, or a pending
Promise<number>when the destination's internal buffer is full (backpressure). The chunk was accepted either way;awaiting the result is enough:await controller.write(chunk);The promise resolves once the destination has drained.
await controller.flush(true)is equivalent.