W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Streams and Blobs

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 26 Feb 2013 10:56:43 +0000
Message-ID: <CADnb78htzcTUr+h2y0BfUD6RkTy=YrdhB0WpQjKfjzAmxNyEOQ@mail.gmail.com>
To: WebApps WG <public-webapps@w3.org>
So currently Mozilla has these extensions to XMLHttpRequest:

 * moz-blob
 * moz-chunked-text
 * moz-chunked-arraybuffer

The first offers incremental read. The latter two offer chunked read
(data can be discarded as soon as it's read).

There's also Microsoft's Streams API which I added to the
XMLHttpRequest draft at some point. SreamReader offers incremental
read, but only from the beginning of the stream, which makes it
nothing more than a Blob which can grow in size over time.

The advantage the Streams API seems to have over moz-blob is that you
do not need to create a new object to read from each time there's
fresh data. The disadvantage is that that's only a minor advantage and
there's a whole lot of new API that comes with it.

Did I miss something?

I'm kinda leaning towards adding incremental Blob and chunked
ArrayBuffer support and removing the Streams API. I can see use for
Stream construction going forward to generate a request entity body
that increases over time, but nobody is there yet.

(Also, in retrospect, I think we should have made Blob's be able to
increase in size over time and not have the synchronous size
getter...)

I've also heard requests for give me the last bit of data that was
transferred (rather than data since last read), for real-time audio. I
think we should probably leave that use case to WebRTC.


-- 
http://annevankesteren.nl/
Received on Tuesday, 26 February 2013 10:57:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:57 GMT