hidalgo-rides/intersect-queue
Composer 安装命令:
composer require hidalgo-rides/intersect-queue
包简介
Queue processing system that allows cron-like processors to be defined and ran using a single script entry point.
README 文档
README
Intersect Queue is a queue processing system that allows cron-like processors to be defined and ran using a single script entry point.
Changelog
See CHANGELOG.md for all released features/bug fixes
Installation via Composer
composer require hidalgo-rides/intersect-queue
Usage
Create custom processors
Create your own custom processors to perform any actions you want to perform at reoccurring times
<?php class SampleProcessor implements \Intersect\Queue\QueueProcessor { public function getFrequency() { // every five minutes return '*/5 * * * *'; } public function process() { // do custom things here like query database records to // perform actions, update stats, or whatever you want } }
Register and run processors with the QueueManager
Create a script to initialize the QueueManager and register all your custom processors
<?php // initialize QueueManager $queueManager = new \Intersect\Queue\QueueManager(); // register processor $queueManager->registerProcessor(new SampleProcessor()); // run QueueManager $queueManager->run();
Setup cron to invoke QueueManager script every minute
* * * * * php /path/to/queue/manager/script.php >> /dev/null 2>&1
License
Intersect Framework is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 292
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-27