Deno: Channels as async iterators

Created on 30 May 2018  路  2Comments  路  Source: denoland/deno

Hey,

V8 ships with async iterators - I was wondering if they should be used for channels as they provide a bi-directional pull stream and have very nice for... await syntax for messages :)

This also comes with all the debugging benefits of being a built-in and a standard between browsers, Node.js and other environments.

Most helpful comment

@benjamingr I love async iterators, but I think for the low-level pub/sub API I'll stick with the current interface for now. async iterators will definitely come in useful for high-level APIs - like reading data from a socket.

All 2 comments

@benjamingr I love async iterators, but I think for the low-level pub/sub API I'll stick with the current interface for now. async iterators will definitely come in useful for high-level APIs - like reading data from a socket.

@ry cool, if the reason is performance then I'm having a session with V8 tomorrow about promise-related performance and would be happy to bring it up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidbarratt picture davidbarratt  路  3Comments

ry picture ry  路  3Comments

ry picture ry  路  3Comments

justjavac picture justjavac  路  3Comments

CruxCv picture CruxCv  路  3Comments