-
Notifications
You must be signed in to change notification settings - Fork 26
DefaultQueue
李铭昕 edited this page Sep 18, 2017
·
1 revision
- 完善Job类
namespace App\Jobs;
use App\Jobs\Contract\JobInterface;
class Test implements JobInterface
{
public $id;
public function __construct($id)
{
$this->id = $id;
}
public function handle()
{
echo $this->id . PHP_EOL;
}
}
- 执行通用消息队列
php run Queue
- PUSH消息到Redis
use App\Utils\Queue;
Queue::push(new Test(1));
-
即可看到消息队列执行结果
-
重载所有失败的Job到队列
php run Queue reloadErrorJobs
- 清除所有失败的Job
php run Queue flushErrorJobs