Closed benaadams closed 6 years ago
Needs the WriteAsync
in pipelines that takes a cancellation token.
This means if Kestrel implemented IDuplexPipe
or better IPipeWriter
https://github.com/dotnet/corefx/issues/27268 on its ResponseStream
the intermediate arrays could go away and encoding could be written directly to the Pipe
; and MVC could take advantage of this with no changes.
This is optimized for synchronous writing of utf8 text to an underlying IBufferWriter<byte>
, https://github.com/aspnet/SignalR/blob/f7fc2647de0f91fbe6322aec95b334ad1437f427/src/Microsoft.AspNetCore.SignalR.Common/Internal/Protocol/Utf8BufferTextWriter.cs. We could try using it here as an alternative to what MVC uses (or try gutting this impl).
@davidfowl @Tratcher is this still relevant/useful in your opinion? If so, let's move it forward. If not, let's get it closed.
Ben, thanks for the PR!
Triage decision: We’re closing this PR because we don’t feel that this change is a good fit for the product at this time.
We thank you for the contribution and look forward to collaborating more in the future.
No additional buffers or
ArrayPool
buffers when Stream implementsIDuplexPipe
Also current
HttpResponseStreamWriter
never ever calledFlush
; even if the user called it or when disposed O_oAdded
/cc @davidfowl @rynowak