問題:
I'm busy writing a small game server to try out flask.我正忙於編寫一個小型遊戲服務器來試用燒瓶。 The game exposes an API via REST to users.遊戲通過 REST 向用戶公開 API。 It's easy for users to perform actions and query data, however I'd like to service the "game world" outside the app.run() loop to update game entities, etc. Given that Flask is so cleanly implemented, I'd like to see if there's a Flask way to do this.用戶很容易執行操作和查詢數據,但是我想在 app.run() 循環之外爲“遊戲世界”提供服務以更新遊戲實體等。鑑於 Flask 實現得如此乾淨,我想看看是否有 Flask 方法可以做到這一點。