[whatwg] Fetch API: HTTP Stream

2014-06-23 Thread Alexandre Morgaut
Hi,

I occasionally have had to deal live XML feeds over HTTP
The server continuously sent HTTP chunks during the lifetime of the HTTP 
connection, meaning, until the client close the connection.

I used a SAX JS lib and, on readystate === 3,  had to continuously check body 
changes via a setInterval callback.
While the body started to be too big, I also had to create  a new request and 
close the previous one once the new connection was ready
(and of course I had to take care of potential duplicates)

Other Comet technics could have been used, but I already have hard time to get 
at least this option

Of course, today, I'd do my best to ask for Web Socket of Server-Sent Event 
alternatives, but I'm not sure I would have get it in the same situation.

With XHR2, I wondered if there could be a way to not full the body property but 
receive the content in some 'chunk' event.data property

I wonder now if such fetch API could be a better place to manage such use case

Regards,




Alexandre Morgaut
Wakanda Community Manager

4D SAS
60, rue d'Alsace
92110 Clichy
France

Standard : +33 1 40 87 92 00
Email :alexandre.morg...@4d.com
Web :  www.4D.com




Re: [whatwg] Fetch API: HTTP Stream

2014-06-23 Thread Anne van Kesteren
On Mon, Jun 23, 2014 at 1:36 PM, Alexandre Morgaut
alexandre.morg...@4d.com wrote:
 I wonder now if such fetch API could be a better place to manage such use case

The plan is for response.body (the promise fetch() returns resolves
once all the headers are in) to be a stream:
http://fetch.spec.whatwg.org/#body-stream-concept

If you want to contribute to IO stream development:
https://github.com/whatwg/streams


-- 
http://annevankesteren.nl/


Re: [whatwg] Fetch API: HTTP Stream

2014-06-23 Thread Alexandre Morgaut
Thanks for the redirection Anne

On 23 juin 2014, at 13:42, Anne van Kesteren ann...@annevk.nl wrote:

 On Mon, Jun 23, 2014 at 1:36 PM, Alexandre Morgaut
 alexandre.morg...@4d.com wrote:
 I wonder now if such fetch API could be a better place to manage such use 
 case

 The plan is for response.body (the promise fetch() returns resolves
 once all the headers are in) to be a stream:
 http://fetch.spec.whatwg.org/#body-stream-concept

 If you want to contribute to IO stream development:
 https://github.com/whatwg/streams


 --
 http://annevankesteren.nl/





Alexandre Morgaut
Wakanda Community Manager

4D SAS
60, rue d'Alsace
92110 Clichy
France

Standard : +33 1 40 87 92 00
Email :alexandre.morg...@4d.com
Web :  www.4D.com