Closed Luminoth closed 2 years ago
This should resolve https://github.com/zamazan4ik/aws-gamelift-server-sdk-rs/issues/5. It's not super pretty but it definitely fixes the contention.
Thanks for the PR. I am merging it. If you have any additions or anything else - feel free to open the PR.
I will release the new version tomorrow.
Move mutable session state data into its own, RW guarded struct (this can use a parking_lot lock since it doesn't cross an await boundary) Guard ServerStateInner with a RW lock instead of a Mutex so it can have multiple consumers without contention Most ServerState methods don't need a mutable self anymore Most API methods don't need a mutable self anymore impl Default on HttpClient so that ServerState can derive Default Log after calling activate_game_session so we know it didn't lock up