-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean StreamConfigurationService
?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
i dont think it make sense to expose |
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.