- From: Mattias Buelens <notifications@github.com>
- Date: Mon, 04 Oct 2021 12:09:42 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 4 October 2021 19:09:55 UTC
Unfortunately, we can't, because the underlying byte source could have *transferred* the BYOB view's buffer: ```javascript const view = c.byobRequest.view; worker.postMessage(view, [view.buffer]); c.close(); ``` That's why we have to *wait* until the source (eventually) calls `.respond()` or `.respondWithNewView()`, for example: ```javascript worker.onmessage = (event) => { c.byobRequest.respondWithNewView(event.message.view); }; ``` Only then we regain control over the BYOB view, allowing us to resolve the `read(view)` request(s). -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/1170#issuecomment-933773946
Received on Monday, 4 October 2021 19:09:55 UTC