Skip to content

Running Rocket inside LocalSet does not work. #2819

Closed Answered by the10thWiz
lolhol asked this question in Questions
Discussion options

You must be logged in to vote

After re-reading your comment - local set doesn't work in nested tasks. You need to create and await the local set in the request handler.

Original:
Rocket is Send, so you should just spawn it with Tokio. spawn_local is worse for performance, so you should only use it if you need to.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by the10thWiz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants