- From: Mattias Buelens <notifications@github.com>
- Date: Thu, 13 Jan 2022 23:35:57 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 14 January 2022 07:36:09 UTC
We ended up with a slightly different approach for #1103. Instead of adding a new API that accepts an `AbortSignal`, we changed the behavior of `reader.releaseLock()`. So the above example would look like this: ```javascript const reader = readable.getReader({ mode: 'byob' }); const signal = AbortSignal.timeout(10_000); signal.addEventListener('abort', () => reader.releaseLock()); // Or alternatively: setTimeout(() => reader.releaseLock(), 10_000); // Use reader as normal const { done, value } = await reader.read(new Uint8Array(1024), { atLeast: 32 }); ``` -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/1143#issuecomment-1012846977 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/streams/issues/1143/1012846977@github.com>
Received on Friday, 14 January 2022 07:36:09 UTC