-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Async Console I/O APIs #299
Comments
There are so many overloads on textwriter. Accessing Only |
Also, at least under Windows, but I would assume other implementations are similar, the in/out streams are implemented as synchronous-only streams, so the proposal to have first-class async methods on Console would be a misleading hidden threadpool block. |
By default, we only serve files with known MIME types, but that is an issue when dotnet library tests consume over a hundred different file extensions in their tests
These don't seem particularly useful: usually you want to block until the output was written. + public static Task<int> ReadKeyAsync(CancellationToken cancellationToken);
+ public static Task<string> ReadLineAsync(CancellationToken cancellationToken); These have a UX race between cancellation and the user providing input: was the input for the previous or the next caller? If
I think we may perform the read on a separate thread where it blocks until there is input. |
Proposal
Async Console I/O APIs
Since now we can write
async Task Main
, I think it's necessary to add APIs to support cancellable async console I/O operations without needs of operatingConsole.In
,Console.Out
directly for converience.Proposed APIs
The text was updated successfully, but these errors were encountered: