- 授权协议: MIT
- 开发语言: Python
- 操作系统: 跨平台
- 软件首页: https://github.com/ui/rq-scheduler
- 软件文档: https://github.com/ui/rq-scheduler
软件介绍
RQ Scheduler 是一个小型的 Python 包,用来给 RQ 添加作业调度功能。
安装:
pip install rq-scheduler
示例代码:
from redis import Redis from rq_scheduler import Scheduler from datetime import datetime scheduler = Scheduler(connection=Redis()) # Get a scheduler for the "default" queue # Puts a job into the scheduler. The API is similar to RQ except that it # takes a datetime object as first argument. So for example to schedule a # job to run on Jan 1st 2020 we do: scheduler.enqueue_at(datetime(2020, 1, 1), func) # Here's another example scheduling a job to run at a specific date and time (in UTC), # complete with args and kwargs. scheduler.enqueue_at(datetime(2020, 1, 1, 3, 4), func, foo, bar=baz)
第二种方法:
from datetime import timedelta # Schedule a job to run 10 minutes, 1 hour and 1 day later scheduler.enqueue_in(timedelta(minutes=10), count_retweets, tweet_id) scheduler.enqueue_in(timedelta(hours=1), count_retweets, tweet_id) scheduler.enqueue_in(timedelta(days=1), count_retweets, tweet_id)
疯狂Java讲义(第4版)
李刚 / 电子工业出版社 / 2018-1 / 109
《疯狂Java讲义(第4版)》是《疯狂Java讲义》的第4版,第4版保持了前3版系统、全面、讲解浅显、细致的特性,全面新增介绍了Java 9的新特性。 《疯狂Java讲义(第4版)》深入介绍了Java编程的相关方面,《疯狂Java讲义(第4版)》内容覆盖了Java的基本语法结构、Java的面向对象特征、Java集合框架体系、Java泛型、异常处理、Java GUI编程、JDBC数据库编程、J......一起来看看 《疯狂Java讲义(第4版)》 这本书的介绍吧!
