python python的企业调度程序(如quartz)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1727138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 22:57:38  来源:igfitidea点击:

An enterprise scheduler for python (like quartz)

pythonscheduled-tasksenterprisequartz-scheduler

提问by flybywire

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements:

我正在寻找适用于 Python 的企业任务调度程序,就像适用于 Java 的quartz。要求:

  • Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and must be fired after restarting.
  • Jobs must enter and exit the scheduler in a transaction (i.e. if some database operation fail, in a database unrelated to the scheduler, then the job must not have exited or entered the scheduler).
  • Scalability. Depends on the measure of success of the project, but I would prefer to know from the beggining that I am not starting from a dead end.
  • Configurability: when tasks expire, how many can be fired simultaneously, etc.
  • 持久性:如果进程重新启动或机器重新启动,那么所有作业必须留在那里并且必须在重新启动后被触发。
  • 作业必须在事务中进入和退出调度程序(即,如果某个数据库操作失败,在与调度程序无关的数据库中,则作业必须没有退出或进入调度程序)。
  • 可扩展性。取决于项目成功与否的衡量标准,但我更愿意从一开始就知道我不是从死胡同开始。
  • 可配置性:任务何时到期,可以同时触发多少任务等。

Any recommendations? Is there something python specific, or is it possible (or even good) to interface to Quartz from python.

有什么建议吗?是否有特定于 python 的东西,或者是否有可能(甚至很好)从 python 接口到 Quartz。

采纳答案by inspectorG4dget

Is APSchedulerwhat you're looking for?

APScheduler你在找什么?

回答by user

You can use Celery

你可以用芹菜

Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well.

Celery 是一个基于分布式消息传递的异步任务队列/作业队列。它专注于实时操作,但也支持调度。

Install Celery using pip install celery

安装芹菜使用 pip install celery

Another option is using RQ.

另一种选择是使用RQ

RQ (Redis Queue) is a simple Python library for queueing jobs and processing them in the background with workers. It is backed by Redis and it is designed to have a low barrier to entry. It should be integrated in your web stack easily.

RQ(Redis Queue)是一个简单的 Python 库,用于排队作业并在后台与工作人员一起处理它们。它由 Redis 提供支持,旨在降低进入门槛。它应该很容易集成到您的网络堆栈中。

Install using pip install rq.

安装使用pip install rq.

回答by Edward Dale

We're using Sun Grid Engine, which is accessible through DRMAA, which happens to have Python bindings.

我们正在使用Sun Grid Engine,它可以通过DRMAA访问,它恰好具有Python 绑定