コード例 #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());
 }
コード例 #2
0
ファイル: PipeReaderExtensions.cs プロジェクト: mztikk/RPipes
        public static async IAsyncEnumerable <string> ReadLines(this PipeReader reader)
        {
            string line;

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