Use C# async iterator to implement ChannelReader.ReadAllAsync (dotnet/corefx#35745)
authorStephen Toub <stoub@microsoft.com>
Mon, 4 Mar 2019 20:13:52 +0000 (12:13 -0800)
committerGitHub <noreply@github.com>
Mon, 4 Mar 2019 20:13:52 +0000 (12:13 -0800)
commitff644f2aec42b525514cb458851558b456650148
tree1f8256f091ad39e358844a6c4974282f3fda3093
parent7581341da36abec157341b48e9fb9e552150d41b
Use C# async iterator to implement ChannelReader.ReadAllAsync (dotnet/corefx#35745)

While the hand-written implementation is a bit faster than what the compiler currently generates, it's also a lot more code, and complex, error-prone code.  Better to go with the simpler implementation, and work to improve the compiler for the future.

Commit migrated from https://github.com/dotnet/corefx/commit/0ce020951d5956916a9084820cefe3684d19f856
src/libraries/System.Threading.Channels/src/System/Threading/Channels/ChannelReader.netcoreapp.cs
src/libraries/System.Threading.Channels/tests/ChannelTestBase.netcoreapp.cs