Skip to content

Conversation

@twsouthwick
Copy link
Contributor

ASP.NET framework had a fully buffered response stream that allowed things like clearing the response stream and setting a flag to not write things out. In order to enable that, a new IHttpResponseBodyFeature is inserted via middleware that will allow for that behavior.

ASP.NET framework had a fully buffered response stream that allowed things like clearing the response stream and setting a flag to not write things out. In order to enable that, a new IHttpResponseBodyFeature is inserted via middleware that will allow for that behavior.
}
}

public void End() => Task.Run(async () => await CompleteAsync()).GetAwaiter().GetResult();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the Task.Run accomplish? You're still blocked waiting for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the pattern I've seen recommended for sync over async. If it doesn't matter in asp.net core (since there's no synchronization context), I can just wait for it directly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter in core, wait directly.

@twsouthwick twsouthwick merged commit c4ece0b into main Mar 24, 2022
@twsouthwick twsouthwick deleted the tasou/httpresponse branch March 24, 2022 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants