Re: [Raw Socket API]: Working on a version based on the Streams API

On Monday, January 27, 2014 at 9:36 AM, Kenneth Rohde Christiansen wrote:

> That is great news Claes!
> 
> As far as I understand the WHATWG streams API would work without the DOM, ie. for nodejs as well, but I guess that Marcos could explain all the details.

This is correct. The primitives aspect of the API is being designed to be a language-level feature, but is itself implementable in JS. This is a huge win as it means that the Node community could basically adopt it wholesale without needing to wait on TC39. For us (W3C/Web people), it means that we could get a standard interface for lower-level stuff to hook into without (hopefully) too many problems. 

The proof is, of course, in the pudding ... as they say. This is where something like the Raw Sockets API comes in, as it serves as both the higher level consumer AND the native data provider for the streams API. If it's usable with Raw Sockets, then we might be onto a winner. There are also other APIs in the wings wanting to use this feature... the goal is getting them all to align. 

The W3C version of the API will provide DOM related primitives, such as the ability to use a stream as a URL. This is useful for things like:

img.src = someStreamURL;
video.src = videoStreamURL; 

I can't remember the exact mechanics to get the url... I think it was something like Stream.toObjectURL()... but it's something simple like that. 
 
-- 
Marcos Caceres

Received on Friday, 31 January 2014 18:32:24 UTC