yutakahirano / fetch-with-streams

Fetch API integrated with Streams.
66 stars 8 forks source link

Specify stream chunk type. #19

Closed yutakahirano closed 9 years ago

yutakahirano commented 9 years ago

Requested at https://github.com/slightlyoff/ServiceWorker/issues/452#issuecomment-73058012 by @wanderview.

yutakahirano commented 9 years ago

blocked by https://github.com/yutakahirano/fetch-with-streams/issues/17.

wanderview commented 9 years ago

Thanks Yutaka!

Can we also specify how the size of the ArrayBuffer is determined? Is the UA free to chunk the data however it wishes? Or does it have to return all available data in a single chunk when read() is called?

yutakahirano commented 9 years ago

Is the UA free to chunk the data however it wishes?

Yes. By the way, I'm planning to use ReadableByteStream instead of ReadableStream when it gets stable enough (now it's not stable enough, so I will use ReadableStream for quite a while). It has readInto() function and the user can specify the buffer size with it.

yutakahirano commented 9 years ago

memo: I created a branch https://github.com/yutakahirano/fetch-with-streams/tree/use-arraybuffer-as-chunk for this issue. Its parent is https://github.com/yutakahirano/fetch-with-streams/tree/readable-stream-and-response which is a branch for #17.