Remove Task{CompletionSource} allocations from Http2Stream (dotnet/corefx#35522)
authorStephen Toub <stoub@microsoft.com>
Sat, 23 Feb 2019 10:00:31 +0000 (05:00 -0500)
committerGitHub <noreply@github.com>
Sat, 23 Feb 2019 10:00:31 +0000 (05:00 -0500)
commit6751207ccac47594062864d41d9e240076150b27
treed524430b05ce6591ff36c010d28d86496a0afa77
parent99e61b0a73821f1a7b40172d0fdd2d40eb3411e9
Remove Task{CompletionSource} allocations from Http2Stream (dotnet/corefx#35522)

* Remove Task{CompletionSource} allocations from Http2Stream

This change makes the Http2Stream instance itself awaitable via ValueTask, such that we don't need to allocate any additional TaskCompletionSource or Task objects for such internal await'ing, regardless of how many times the Http2Connection or Http2ReadStream needs to wait for headers or response data to arrive.

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/aacff5212204ee54e3b3e0172fcf364c3fe253e3
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs