Is it possible to have !Send handler for requests ? #2522
-
SummaryI use a http request processing library which has a !Send constraint. Is it possible to run a multi-threaded axum server and have it assign a dedicated thread for each incoming request that would explicitly allow !Send ? I've initially created a Service, but then noticed that Router Layer cannot be used because of Send constraint for the service : axum version0.7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No that’s not possible. axum requires I think your best option is to spawn a dedicated thread and communicate with it via channels. |
Beta Was this translation helpful? Give feedback.
No that’s not possible. axum requires
Send
. Allowing!Send
would basically require duplicating all the code because of how auto traits work in trait objects.I think your best option is to spawn a dedicated thread and communicate with it via channels.