Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Not possible for Response implementations to write async content. #2067

Open
jlennox opened this issue Oct 3, 2015 · 5 comments
Open

Not possible for Response implementations to write async content. #2067

jlennox opened this issue Oct 3, 2015 · 5 comments

Comments

@jlennox
Copy link
Contributor

jlennox commented Oct 3, 2015

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.

@khellang
Copy link
Member

khellang commented Oct 3, 2015

👍 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> 😄

I'll leave this open for tracking ⌚

@khellang khellang added this to the 2.0 milestone Oct 3, 2015
@damianh
Copy link
Member

damianh commented Dec 7, 2015

Waiting for #2105 to be merged first.

@khellang khellang modified the milestones: 2.0, 2.0-beta Mar 22, 2016
@btrepp
Copy link

btrepp commented May 4, 2016

Any news on this?.
Would be nice if Process on IResponseProcessor could return a Task instead of Response.
Or that Response.Contents Can take Func<Stream,Task> instead of Action

@thecodejunkie thecodejunkie modified the milestones: 2.0-barneyrubble, 2.1 Jul 12, 2016
@corentinaltepe
Copy link

Hi, was this implemented with v2.0.0 ? I can't seem to find the method.

@tasoss
Copy link

tasoss commented Sep 27, 2019

Any update?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants