Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Http2Connection.StartWriteAsync to use a callback model #37353

Merged
merged 3 commits into from
Jun 4, 2020

Commits on Jun 3, 2020

  1. 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.
    stephentoub committed Jun 3, 2020
    Configuration menu
    Copy the full SHA
    fe2b8b7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4395ed6 View commit details
    Browse the repository at this point in the history
  3. Address PR feedback

    stephentoub committed Jun 3, 2020
    Configuration menu
    Copy the full SHA
    5d3c742 View commit details
    Browse the repository at this point in the history