如何根据Google App Engine中的用户参数安排重复的作业或任务? [英] How to schedule repeated jobs or tasks from user parameters in Google App Engine?

查看:93
本文介绍了如何根据Google App Engine中的用户参数安排重复的作业或任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Google App Engine,我希望能够安排基于用户参数的作业。

I'm using Google App Engine and I want like to be able to schedule jobs based users' parameters.

我知道这可以通过cron作业完成,但看起来它不允许用户的任何灵活性,但它只允许预定义作业。

I know this can be done with cron jobs, but looks like it does not allow any flexibility from the user's point of view, but it allows only to schedule predefined jobs.

例如,假设我有一个新闻应用程序,用户可以订阅不同的主题:我希望管理员能够决定何时发送摘要电子邮件,例如,每天早上8点,我希望他能够编辑它。

For example, suppose I have a news app where users can subscribe to different topics: I want the admin to be able to decide when to send a summary email, for instance, every day at 8am, and I want him to be able to edit this.

有什么可以提供吗?

Is there anything that provides this?

推荐答案

你可能想要问题3638:Cron作业将以编程方式安排

与此同时,您可以编写自己的实现:定期运行一个通用的cron作业(每1分钟为最佳分辨率),并在该cron内部作业检查用户编程的调度数据保存在某处(例如在数据存储区中),如果需要,可以触发执行任何需要执行的操作,可以内联或将某个任务排入某个任务队列。

Meanwhile you can write your own implementation: have a generic cron job running periodically (every 1 minute being the finest resolution) and inside that cron job check user-programmed scheduling data persisted somewhere (in the datastore for example) and, if needed, trigger execution of whatever is needed to be executed, either inlined or by enqueueing a task in some task queue.

如果需要,甚至可以在1分钟内驱动调度分辨率,请参阅使用Google App Engine进行高频数据刷新

It's possible to drive the scheduling resolution even under 1 minute, if needed, see High frequency data refresh with Google App Engine

这篇关于如何根据Google App Engine中的用户参数安排重复的作业或任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆