I'm curious to see if a transferred readable stream gets destroyed if you close the page.
For starter, it can't be a polyfilled stream or a own custom readable/writable stream or transformation.
it has to come from some native stream like the new native Blob.stream() or Response.body
Secondly dose it work while it's piped to a native identity TransformStream?
need to test 2 things
1) fetch something large or something that can throttle
2) get the response.body stream
3) transfer that to service worker
4) close the page (not the browser)
5) respond back or try to read all of stream while it's still fetching data from the request
1) fetch something large or something that can throttle
2) get the response.body stream (call it A)
3) get a identity transform stream { writable, readable: B } = new TransformStream()
4) pipe A to writable (A.pipeTo(writable))
5) transfer B to service worker
6) close the page (not the browser)
7) respond back or try to read all of stream while it's still fetching data from the request
(StreamSaver was not built for saving a ReadableStream that you already have, it was built with WritableStream in mind, so maybe we want to change it?)
For a long time i wished StreamSaver could just save a ReadableStream so you don't have to write to.. most of the time you already have a readable stream anyway. Just pass the readableStream along from some existing source without piping.
if you still want to have a writable api you would just have to create a identity stream
I'm curious to see if a transferred readable stream gets destroyed if you close the page.
For starter, it can't be a polyfilled stream or a own custom readable/writable stream or transformation. it has to come from some native stream like the new native
Blob.stream()
orResponse.body
Secondly dose it work while it's piped to a native identity TransformStream?need to test 2 things
1) fetch something large or something that can throttle 2) get the response.body stream 3) transfer that to service worker 4) close the page (not the browser) 5) respond back or try to read all of stream while it's still fetching data from the request
1) fetch something large or something that can throttle 2) get the response.body stream (call it
A
) 3) get a identity transform stream{ writable, readable: B } = new TransformStream()
4) pipeA
towritable
(A.pipeTo(writable)
) 5) transferB
to service worker 6) close the page (not the browser) 7) respond back or try to read all of stream while it's still fetching data from the request(StreamSaver was not built for saving a ReadableStream that you already have, it was built with WritableStream in mind, so maybe we want to change it?)
For a long time i wished StreamSaver could just save a ReadableStream so you don't have to write to.. most of the time you already have a readable stream anyway. Just pass the readableStream along from some existing source without piping. if you still want to have a writable api you would just have to create a identity stream