You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to build to build a tower service chain that calls the "real" HTTP handler after some library-implemented pre-handling logic. One of these is an attempt to use tower_http::AddExtensionLayer to add request-specific state object as an http::request::extension. This gives me this error:
222 | lambda_http::run(service).await?;
| ^^^^^^^^^^^^^^^^ expected an `FnMut<(http::Request<Body>,)>` closure, found `THE TYPE OF THE STATE OBJECT`
So I have some unnatural gymnastics necessary now to make sure that the primary service nest is, indeed, FnMut<(http::Request,).
Any way this ease up this requirement?
The text was updated successfully, but these errors were encountered:
Do you have a simple sample you can share?
Had to do a similar thing for my crate and found this problem a little easier to solve within the context of a single lambda function vs at the library scope.
Well, it's one of those things that "went away" - it was likely to do with not having the correct combinations of Clone, Send and Sync (and maybe 'static) in the Service implementation I was trying.
Comments on closed issues are hard for the maintainers of this repository to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
I'm attempting to build to build a tower service chain that calls the "real" HTTP handler after some library-implemented pre-handling logic. One of these is an attempt to use tower_http::AddExtensionLayer to add request-specific state object as an http::request::extension. This gives me this error:
So I have some unnatural gymnastics necessary now to make sure that the primary service nest is, indeed, FnMut<(http::Request,).
Any way this ease up this requirement?
The text was updated successfully, but these errors were encountered: