Re: [XHR] support for streaming data

On Thu, Aug 18, 2011 at 1:16 PM, Ian Hickson <ian@hixie.ch> wrote:
> On Wed, 17 Aug 2011, Chris Rogers wrote:
>>
>> Also, it would be good to get Ian's opinion about this since he's
>> working on similar stuff with Web Sockets.
>
> Right now WebSockets only works with complete messages, there's no
> streaming support. I suspect that if we add streaming support to the
> protocol and the API, it'll be exposed as some sort of Stream object,
> which would then have a way to get the data out of it in chunked form,
> maybe a growing list of ArrayBuffers or something. I haven't looked at it
> in detail yet.
>
> There would probably be some relationship to MediaStream, too; roc may
> have an opinion on this topic, as he has spoken about it before.

What we're talking about here isn't really "streaming" as much as
"chunked". The equivalent feature would be to be able to incrementally
get data as a large websocket message was delivered.

The usecase would be something like supporting incremental rendering
of attachments, even when the attachment is sent as a single websocket
message.

However I think it's a bit early to start talking about this feature
for websockets. The websocket API doesn't even have support for
progress events for individual messages. And even the basic API is
still far from widely deployed in browsers.

It's also less important since you can always support the use case by
chunking up the attachment into several websocket messages, and
reassemble them manually in the client. This is more work, but should
work.

/ Jonas

Received on Thursday, 18 August 2011 22:21:07 UTC