dotnet / dotnet/dotnet-api-docs

System.Diagnostics.Process docs do not refer to async StreamReader APIs

Aperta
#4,592 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area-System.Diagnostics.Process Pri3
Lingua principale
C#
Stelle
950
Fork
1.7k
Merge medio
2g 19h
PR unite (30g)
52

Descrizione

This issue is spread around a few sections, for example [Process.StandardOutput](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.standardoutput?view=netcore-3.1):

> The redirected `StandardOutput` stream can be read synchronously or asynchronously. Methods such as `Read`, `ReadLine`, and `ReadToEnd` perform synchronous read operations on the output stream of the process. These synchronous read operations do not complete until the associated `Process` writes to its `StandardOutput` stream, or closes the stream.
>
> In contrast, `BeginOutputReadLine` starts asynchronous read operations on the `StandardOutput` stream. This method enables a designated event handler for the stream output and immediately returns to the caller, which can perform other work while the stream output is directed to the event handler.

The description makes it sound like sync = `Read`/`ReadLine` and async = `BeginOutputReadLine`/`OutputDataReceived` where in fact the recommended async approach would surely be the task-based `System.IO.StreamReader.ReadXAsync` (invoked on the supposedly "sync" `StandardOutput`).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla documentazione collegata di System.Diagnostics.Process.StandardOutput e esamina le sezioni correlate che descrivono le letture sincrone e asincrone. Confronta questa formulazione con le API ReadXAsync basate su task di System.IO.StreamReader. Il lavoro è completo quando le sezioni interessate spiegano accuratamente gli approcci asincroni disponibili senza implicare che BeginOutputReadLine sia l’unico.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.