-
-
Notifications
You must be signed in to change notification settings - Fork 6
Use lambda_http 0.5 instead of fork #13
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
Conversation
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.
Thank you for this awesome PR ❤️! And it looks good to me!
@@ -5,11 +5,11 @@ use warp::Filter; | |||
async fn main() -> Result<()> { | |||
// Your warp routes (filters) | |||
let routes = warp::any().map(|| "Hello, World!"); | |||
// Convert them to a warp service (a tower service implmentation) | |||
// Convert them to a warp service (a tower service implementation) |
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.
Good catch!
// using `warp::service()` | ||
let warp_service = warp::service(routes); | ||
// The warp_lambda::run() function takes care of invoking the aws lambda runtime for you | ||
warp_lambda::run(warp_service) | ||
.await | ||
.map_err(|err| anyhow!("An error occured `{:#?}`", err)) | ||
.map_err(|err| anyhow!("An error occurred `{:#?}`", err)) |
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.
Thank you 😅
@@ -2,50 +2,66 @@ use core::future::Future; | |||
use std::convert::Infallible; | |||
use std::pin::Pin; | |||
|
|||
pub use lamedh_http as lambda_http; |
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.
Finally, we are able to get rid of this!
} | ||
|
||
fn call(&mut self, req: Request) -> Self::Future { | ||
let query_params = req.query_string_parameters(); |
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.
Great!
Resolved ✅ Error message when compiling: `error[E0599]: no method named `ready` found for type parameter `F` in the current scope``cargo check` and `cargo build` fails in local (Rust version `1.60.0`) Detailed Error
Resolution: remove |
Merged to |
This PR uses the official lambda_http release 0.5 which fixes awslabs/aws-lambda-rust-runtime#274 and updates the warp adapter to implement
tower::Service
directly now that the lambda http handler has been removed.