12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\task\time;
- use app\job\DemoJob;
- use app\task\Kernel;
- use app\utils\Queue;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- /**
- * 定时任务管理器
- * 业务代码执行时间过长,会造成堵塞,请合理安排执行任务
- * Class Kernel
- * @package app\task
- */
- class DemoTime extends Command{
- protected function configure()
- {
- $this->setName('DemoTime')->setDescription('Here is the remark ');
- }
- // 业务代码 业务代码执行时间过长,会造成堵塞,请合理安排执行任务
- protected function execute(Input $input, Output $output)
- {
- Queue::work(DemoJob::class,['a' => 1]);
- return 0;
- }
- }
|