-
Notifications
You must be signed in to change notification settings - Fork 347
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
Hyper 1 upgrade #749
Hyper 1 upgrade #749
Conversation
This makes tracking versions across packages easier. Signed-off-by: David Calavera <david.calavera@gmail.com>
Copy some of the utils that Axum created to support Hyper 1. Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Switch to use hyper::service::service_fn definitions. Implement new Hyper's polling loop for http connections. Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Given the lack of a public implementation anymore, we don't have other choice but copying Hyper's private implementation. Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
4c3520b
to
8e7519a
Compare
This makes the streaming functionallity more concise. It aliases other functionality to keep backwards compatibility. Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
lambda-http/src/streaming.rs
Outdated
loop { | ||
match futures_util::ready!(self.as_mut().project().body.poll_frame(cx)?) { | ||
Some(frame) => match frame.into_data() { | ||
Ok(data) => return Poll::Ready(Some(Ok(data))), | ||
Err(_frame) => {} | ||
}, | ||
None => return Poll::Ready(None), | ||
} |
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.
Instead of using loop, the following should also work.
return match futures_util::ready!(self.as_mut().project().body.poll_frame(cx)?) {
Some(frame) => match frame.into_data() {
Ok(data) => Poll::Ready(Some(Ok(data))),
Err(_frame) => Poll::Ready(None)
},
None => Poll::Ready(None),
}
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.
I've updated the code with this suggestion, thanks!
Since we pull in 'Body' into this project, we probably need to use it across this project. It is re-exported in both lambda-runtime and lambda-http. |
I understand that it can create confusion, that's why I re-exported the new body as |
Issue #, if available:
fixes #737
fixes #738
Description of changes:
Hyper 1 has moved many things around, and unfortunately how to implement things now is not very clear.
lambda_runtime
lambda_http
lambda-extension
By submitting this pull request