Deno: Can console be nonblocking?

Created on 31 Aug 2018  路  5Comments  路  Source: denoland/deno

It's likely I'm asking this question because I don't have a good understanding of how Operation Systems and I/O work!

A problem that occurs in Node is that printing large log statements will freeze the program. Can we make console printing async in deno?

Most helpful comment

@ry @mohsen1 I think console should stay synchronous as it is elsewhere. I think we could have asynchronous console reading / writing through stdin and stdout streams with the Reader and Writer interfaces.

All 5 comments

@mohsen1 I'd rather keep it synchronous for debugging now. In the future I would be open to changing that...

@ry @mohsen1 I think console should stay synchronous as it is elsewhere. I think we could have asynchronous console reading / writing through stdin and stdout streams with the Reader and Writer interfaces.

as it is elsewhere

One thing to note here is that Chrome has async logging, at least for objects. They don't resolve until you expand them. But since you can't do that in the terminal, so that's there.

I think we could have asynchronous console reading / writing through stdin and stdout streams

I agree with this part.

Now we have deno.stdout.write() and it's async.

I think we can close this @ry

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JosephAkayesi picture JosephAkayesi  路  3Comments

CruxCv picture CruxCv  路  3Comments

zugende picture zugende  路  3Comments

watilde picture watilde  路  3Comments

kyeotic picture kyeotic  路  3Comments