private static async Task ReadLines(PipeReader reader) { System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); System.Console.WriteLine(await reader.PipeReadLine()); }
public static async IAsyncEnumerable <string> ReadLines(this PipeReader reader) { string line; while ((line = await reader.PipeReadLine().ConfigureAwait(false)) is { })