banyancheung / cron-task
crontab task component base on swoft
1.0.0
2019-07-04 08:02 UTC
Requires
- swoft/framework: ~2.0.0
- swoft/task: ~2.0.0
This package is auto-updated.
Last update: 2025-03-04 22:31:57 UTC
README
swoft定时任务组件,核心大部分基于1.0,在此基础上适配了2.0,实测可用。
安装
- composer command
composer require banyancheung/cron-task
- composer.json
"require": { ... "banyancheung/cron-task": "dev-master", ... }
然后 composer update
即可。
使用
1.在app/beans.php
文件里的server
一项,监听 onPipeMessage
事件。
2.在定义好的task注解里,增加 Scheduled 一项。
注意:Scheduled里的task属性是必须的,用于定位是哪个Task,也许会有更好的方法。:)
3.应用配置里增加 cron 配置项
LICENSE
The Component is open-sourced software licensed under the Apache license.