Skip to content

Implement HttpRequest against core.#458

Merged
twsouthwick merged 14 commits into
mainfrom
tasou/httpresponse
Mar 24, 2022
Merged

Implement HttpRequest against core.#458
twsouthwick merged 14 commits into
mainfrom
tasou/httpresponse

Conversation

@twsouthwick
Copy link
Copy Markdown
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.
Comment thread src/SystemWebAdapters/src/Adapters/BufferResponseStreamAttribute.cs
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs Outdated
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs Outdated
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
twsouthwick and others added 4 commits March 22, 2022 16:51
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs Outdated
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs Outdated
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/HttpResponse.cs Outdated
Comment thread src/SystemWebAdapters/src/Adapters/BufferedHttpResponseFeature.cs
twsouthwick and others added 3 commits March 24, 2022 09:43
}
}

public void End() => Task.Run(async () => await CompleteAsync()).GetAwaiter().GetResult();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants