Writing a multiplayer game in Django
I'm planning to write a multiplayer card game in Django. There may be several concurrent games. I already have a Python CardGame class that contains the engine for the game, and for every game that is created I will need one instance of this class, to be open until the game is closed. This object will basically keep the state of the game, and any actions executed by users will be run on this object.
My question is: in Django, how do you create an object that开发者_JAVA百科 can store the state of the game and listen for commands from the Django views, without using a database?
You could look into serializing your data and store it in a key-value store like redis for example (which is superfast).
精彩评论