Share the same app-state between rest and websocket endpoints? #2951
Unanswered
fweichselbaum
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create a backend for a simple turn-based game, and the functionality to create a game works fine. The games are managed in by the
HttpServer App
via theapp_data
method.Then I access the state in the REST endpoints via the
actix_web::web::Data
struct:I plan on handling the actual game implementation with websockets, but by now I haven't found a method to do access the existing app state created with the REST endpoints.
Since I am fairly new to actix and rust in general, my question now is if it is even possible and if yes, how?
Beta Was this translation helpful? Give feedback.
All reactions