Skip to content
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

Async version of Context.ReturnFile? #1164

Closed
GrabzIt opened this issue Oct 6, 2021 · 2 comments · Fixed by #1177
Closed

Async version of Context.ReturnFile? #1164

GrabzIt opened this issue Oct 6, 2021 · 2 comments · Fixed by #1177
Assignees
Labels
Milestone

Comments

@GrabzIt
Copy link

GrabzIt commented Oct 6, 2021

Love Dotvvm! Maybe there is a reason not to do it. However, as ReturnFile is doing disk I/O it should probably be async. Or at least have an async version. Looking, at the code it seems to only be a minor change.

public static void ReturnFile(this IDotvvmRequestContext context, Stream stream, string fileName, string mimeType, IEnumerable<KeyValuePair<string, string>>? additionalHeaders = null, string? attachmentDispositionType = null)

@GrabzIt GrabzIt changed the title There should be a async version of Context.ReturnFile Async version of Context.ReturnFile? Oct 6, 2021
@exyi exyi added this to the Version 4.0 milestone Oct 6, 2021
@exyi
Copy link
Member

exyi commented Oct 6, 2021

You are right. We'll need to add an async version (and probably make this one deprecated)

@tomasherceg
Copy link
Member

Wow, we are calling .Result inside because the underlying service is already async. It seems we forgot to update this method. :-(

@exyi exyi self-assigned this Oct 16, 2021
@exyi exyi added the bug label Oct 16, 2021
exyi added a commit that referenced this issue Oct 16, 2021
exyi added a commit that referenced this issue Oct 16, 2021
exyi added a commit that referenced this issue Oct 16, 2021
exyi added a commit that referenced this issue Oct 16, 2021
exyi added a commit that referenced this issue Oct 16, 2021
exyi added a commit that referenced this issue Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants