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

Improve StaticFiles performance, and make ChunkedReadFile public #571

Closed
wants to merge 5 commits into from
Closed

Improve StaticFiles performance, and make ChunkedReadFile public #571

wants to merge 5 commits into from

Conversation

transkatgirl
Copy link

This fixes issue #560, and also addresses some concerns brought up about ChunkedReadFile.

Sorry about the weird commit names, I was using my phone to do this.

@@ -88,7 +88,8 @@ where
Ok(Async::Ready(()))
}

fn call(&mut self, req: Self::Request) -> Self::Future {
fn call(&mut self, mut req: Self::Request) -> Self::Future {
let _ = req.set_nodelay(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fafhrd91 it is been removed in c674ea9

Do you remember why? Or was it mistake?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is separate service for that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean StreamConfigurationService?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is the simplest solution I found to the issue. If you want to solve the issue in a different way, I could modify the pull request.

file: Option<File>,
fut: Option<CpuFuture<(File, Bytes), io::Error>>,
counter: u64,
pub size: u64,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChunkedReadFile is public and shows up in the documentation, but it isn't useable in handlers, because its fields are private.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, are you okay with this change being included in the pull request?

It makes sense for ChunkedReadFile's fields to be public, as it's not useable when the fields are private. Why have ChunkedReadFile show up in the docs if you don't want people to use it?

@fafhrd91
Copy link
Member

fafhrd91 commented Nov 9, 2018

i dont think it make sense to expose ChunkedReadFile atm, it is too specific to actix-web. i hid it for now. also added nodelay in master

@fafhrd91 fafhrd91 closed this Nov 9, 2018
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.

None yet

3 participants