how to use tokio::sync::mpsc::Sender<bool> in State #3215
Closed
alidehghan
started this conversation in
General
Replies: 1 comment 2 replies
-
for those people like me, wondering this exotic behaviors, just put with_state at the end of lines of Router.... following code makes error: let app = Router::new()
.route("/{*wildcard}", get(handlers::get_banner).post(handlers::process))
->>> .with_state(self.capacity_manager_question_channel.clone());
.fallback(get(handlers::get_banner)); while following code is ok !!! let app = Router::new()
.route("/{*wildcard}", get(handlers::get_banner).post(handlers::process))
.fallback(get(handlers::get_banner))
->>> .with_state(self.capacity_manager_question_channel.clone()); yes, that is 4-hour searching!!! nothing documented in axum state website! thanks axum guys for such beautiful coding. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the following struct, and wants to use as State in my handler
my handler is:
and my sever is :
and got this error:
could you please help me?
Beta Was this translation helpful? Give feedback.
All reactions