-
SummaryHey fellow axumates. I'm working on a project at https://git.sr.ht/~latex/streamlist
Preferably I don't want to use yet another thread just for xrust. Is it even possible to make the middleware non-Send? Does axum even support that or not? What about actix-web? axum version0.7.7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Using a non- If you don't need to hold the |
Beta Was this translation helpful? Give feedback.
Using a non-
Send
type inside of anasync fn
does not automatically make its future type non-Send
. That only happens when you declare a binding of such a type before the last.await
point (roughly speaking).If you don't need to hold the
RNode
across a.await
point, the best solution is probably to move all thexrust
logic into a regularfn
that is called by yourasync fn
. I took a brief look at your code and think this should work there.