vezel-dev / cathode

A terminal-centric replacement for the .NET console APIs.
https://docs.vezel.dev/cathode
BSD Zero Clause License
91 stars 7 forks source link

Provide asynchronous API surface #47

Closed alexrp closed 2 years ago

alexrp commented 2 years ago

A common complaint with System.Console is that it has very limited support for asynchronous operations. The only real support is grabbing e.g. Console.Out and using the asynchronous methods on TextWriter. We support that too, but I think we can do better.

alexrp commented 2 years ago

I don't think we'll ever go as far as plumbing asynchronous I/O all the way down to the drivers (using e.g. IOCP). That would be neat in a sense, but it would also massively increase the complexity of the driver code for relatively little benefit.

Providing Task.Run-based wrappers around the synchronous APIs should be good enough in practice.

alexrp commented 2 years ago

This partially ties into: