Skip to content

Commit

Permalink
fix: Ignore Exceptions in PipeReader.CopyToAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Aug 10, 2021
1 parent 1a22be0 commit 5198c97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Pipelines.Extensions/PipelinesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ public static async ValueTask LinkToAsync(this IDuplexPipe pipe1, IDuplexPipe pi
var a = pipe1.Input.CopyToAsync(pipe2.Output, token);
var b = pipe2.Input.CopyToAsync(pipe1.Output, token);

await Task.WhenAny(a, b); // TODO: Use WhenAll? .NET6.0
var task = await Task.WhenAny(a, b);
if (task.IsCompletedSuccessfully)
{
await Task.WhenAll(a, b);
}
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 5198c97

Please sign in to comment.