python - 如何在 GAE 上定期运行 Python 函数

标签 python google-app-engine channel-api

我正在为我的浏览器游戏开发一个 python 服务器(在 GAE 上运行)。到目前为止一切都运行良好。我无法在 GAE 上运行计时器,所以我不知道如何定期通知所有客户端有关服务器上的更改。

我当前的想法是,客户端向服务器发送消息。服务器管理接收到的数据,并在短时间内向所有连接的客户端发送更新。但我无法运行计时器,所以我不知道该怎么做。

你有什么想法吗?

谢谢托克斯

编辑:我忘了说,我需要非常小的间隔 - 比如 100 毫秒。所以 Cron 并不是一个很好的解决方案。

最佳答案

使用 App Engine 的 Cron Service为此

A cron.yaml file in the root directory of your application (alongside app.yaml) configures scheduled tasks for your Python application

关于python - 如何在 GAE 上定期运行 Python 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17216656/

相关文章:

java - 将算法 C 翻译成 Python

python - 为什么即使 verb.exc 添加了正确的值,NLTK 词形还原也有错误的输出?

python - Django 实例在 Google App Engine 下启动

google-app-engine - 无法使用 SQLAlchemy 从开发服务器连接到 Google Cloud SQL

google-app-engine - Google App Engine channel API 定价 : $0. 01 或 100 个 channel 的 0.001 美元?

python - 使用 matplotlib 可视化数据

java - 适用于 Java 的博客软件/平台

google-app-engine - channel api : persistent disconnections and connections

c++ - 用于 c/c++ 客户端的 Google channel API

python - 从python程序执行c程序