| [ Web Proxy ] |
| Viewing: https://developers.cloudflare.com/workers/runtime-apis/streams/readablestreamdefaultreader/ | [Back] [Original] |
A reader is used when you want to read from a ReadableStream, rather than piping its output to a WritableStream.
A ReadableStreamDefaultReader is not instantiated via its constructor. Rather, it is retrieved from a ReadableStream:
const { readable, writable } = new TransformStream();
const reader = readable.getReader();
reader.closed : Promise
read() : Promise
cancel(reasonstringoptional) : void
reason is an optional human-readable string indicating the reason for cancellation. reason will be passed to the underlying sources cancel algorithm -- if this readable stream is one side of a TransformStream, then its cancel algorithm causes the transforms writable side to become errored with reason.Warning
Any data not yet read is lost.
releaseLock() : void
TypeError is thrown and the reader remains locked.| Web Proxy Viewer | New URL | Original Page |