Don't throw in the On* callbacks (dotnet/corefx#38327)
authorDavid Fowler <davidfowl@gmail.com>
Fri, 7 Jun 2019 14:24:21 +0000 (07:24 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Jun 2019 14:24:21 +0000 (07:24 -0700)
commit87cf9302724612d1c88a37f8396ed6ac2ccdcda4
treefeaac993766ee6cda53ae966df1588d6e031f1f3
parent17ca12dcbcb8f43628935349ec42781b8227b4f3
Don't throw in the On* callbacks (dotnet/corefx#38327)

- We can't throw NotSupportedException in the OnWriterCompleted and OnReaderCompleted callbacks since consumers of the API won't know if it's safe to do so. We could add a SupportsOn* boolean but nooping is a much simpler solution without breaking existing callers. We can also add a boolean in the future so callers will know when they can register callbacks or not.

Commit migrated from https://github.com/dotnet/corefx/commit/672cc2c985d1f6f00afe853e678ed05de9757724
src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs
src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs
src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs
src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs