Skip to content

Is it possible to have !Send handler for requests ? #2522

Answered by davidpdrsn
artem-tim asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@artem-tim
Comment options

@davidpdrsn
Comment options

@artem-tim
Comment options

Answer selected by artem-tim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants