Example #1
0
 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());
 }
Example #2
0
        public static async IAsyncEnumerable <string> ReadLines(this PipeReader reader)
        {
            string line;

            while ((line = await reader.PipeReadLine().ConfigureAwait(false)) is { })