推拉函数与queue
This commit is contained in:
35
app/Jobs/AddPostQueue.php
Normal file
35
app/Jobs/AddPostQueue.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Post\PostPushBoxModel;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class AddPostQueue implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
* @throws ModelException
|
||||
*/
|
||||
public function handle(array $params): void
|
||||
{
|
||||
$oPostPushBoxModel = new PostPushBoxModel();
|
||||
$oPostPushBoxModel->addPostQueueConsumer($params);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user