Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Http2Connection.StartWriteAsync to use a callback model (#37353)
* Change Http2Connection.StartWriteAsync to use a callback model In all of the places we use StartWriteAsync, it's followed by some amount of synchronous work and then releasing the lock. We can instead pass that synchronous work into StartWriteAsync as a callback. This has a few benefits: 1. If/when StartWriteAsync completes asynchronously, in most of the call sites we don't incur another async method then completing asynchronously and allocating its state machine, or needing to call through another layer of state machines. 2. We can have spans as locals inside of the callbacks as they're not async methods, which lets us reduce the number of times we access Memory.Span. 3. We can more easily experiment with different execution models around invoking the work waiting for the lock. * Tweak Active/AvailableMemory properties/methods * Address PR feedback
- Loading branch information