-
Notifications
You must be signed in to change notification settings - Fork 347
Implement HttpRequest against core. #458
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
Conversation
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.
src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
Outdated
Show resolved
Hide resolved
src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
Outdated
Show resolved
Hide resolved
src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Ross <[email protected]>
Co-authored-by: Chris Ross <[email protected]>
src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
Outdated
Show resolved
Hide resolved
src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
Outdated
Show resolved
Hide resolved
src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Ross <[email protected]>
Co-authored-by: Chris Ross <[email protected]>
| } | ||
| } | ||
|
|
||
| public void End() => Task.Run(async () => await CompleteAsync()).GetAwaiter().GetResult(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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.