giongto35 / cloud-game

Web-based Cloud Gaming service for Retro Game
https://www.youtube.com/watch?v=GUBrJGAxZZg
Apache License 2.0
2.32k stars 348 forks source link

Track worker's user count. #327

Closed sergystepanov closed 3 years ago

sergystepanov commented 3 years ago

If a worker is shared, then without tracking players it's impossible to tell when it's free, so we add a simple (not thread safe, meh) user counter.

giongto35 commented 3 years ago

oh don't know why I did like that : D This would fix the issue. Don't know if IsAvailability is necessary because I have this cleanWorker based on room count here https://github.com/giongto35/cloud-game/blob/747d0d702ca19e9e82c9a8e25d5cd841f45feca3/pkg/coordinator/handlers.go#L376