Nancy
Nancy copied to clipboard
Not possible for Response implementations to write async content.
Proposed solution: In addition to Action<Stream> Contents
there could be Action<Task<Stream>> AsyncContents
which takes presidence when non-null.
An example of code that suffers from the non-presence of this feature: https://github.com/NancyFx/Nancy/blob/master/src/Nancy/Responses/StreamResponse.cs
StreamResponse will block the thread during read and write IO.
:+1: This will be done as part of the 2.0 overhaul.
We're planning on dropping 4.0 support and go full-blown async/await all over the place.
The Contents
property will most likely be a Func<Stream, Task>
:smile:
I'll leave this open for tracking :watch:
Waiting for #2105 to be merged first.
Any news on this?. Would be nice if Process on IResponseProcessor could return a Task<Response> instead of Response. Or that Response.Contents Can take Func<Stream,Task> instead of Action<Stream>
Hi, was this implemented with v2.0.0 ? I can't seem to find the method.
Any update?