Deno: Implement WHATWG Streams

Created on 13 Dec 2019  路  8Comments  路  Source: denoland/deno

We should implement the Streams API in Deno and utilise it appropriately in other APIs, where things like back pressure are needed/useful.

More easy to understand information is available on MDN.

Most helpful comment

Unfortunately you're probably right... I think the Stream API is unnecessarily complicated. I've presented my alternative version of streaming by porting Golang's I/O system, which include things like Deno.copy. That said, users don't care, they just want browser-like...

All 8 comments

Unfortunately you're probably right... I think the Stream API is unnecessarily complicated. I've presented my alternative version of streaming by porting Golang's I/O system, which include things like Deno.copy. That said, users don't care, they just want browser-like...

Might deno-streams by @keroxp be useful here?

The WHATWG Streams API feels more like nothing more to add rather than nothing left to take away, very Java-like and verbose but certainly powerful. A port of Golang's I/O might be more elegant but if Deno needs to support WHATWG Streams anyway for browser compatibility then the question is if it makes more sense to use a better streams API where there is no need for WHATWG streams (having two APIs, maybe one built on top of the other) or to use one API everywhere (which couldn't be something not compatible with WHATWG Streams, unfortunately).

I think this has been largely implemented now.

I needed some of the fetch and Body methods that are related to streams and saw them as not-implemented (getIterator and getReader specifically). I would like to give it a try and implement them.

Would it make sense to reuse the reference implementation of whatwg streams and reuse them to implement Body stream related methods?

fetch is being rewritten to align to the standards.

How can I help? Is there an issue?

Not easily right now, as it is also an experiment on how to structure operations in the internals of Deno. I am afraid it is best to just hold tight at the moment on fetch.

I've presented my alternative version of streaming by porting Golang's I/O system, which include things like Deno.copy

@ry, do you happen to have it anywhere accessible?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

kitsonk picture kitsonk  路  3Comments

ry picture ry  路  3Comments

ry picture ry  路  3Comments

justjavac picture justjavac  路  3Comments