| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Servers;
- use App\Jobs\BoadcastDetectionJob;
- use App\Jobs\BusinessFileJob;
- use App\Jobs\CreatBothJob;
- use App\Jobs\MsgFileJob;
- use App\Models\BlockItems;
- /**
- * Redis数据缓存类
- */
- class JobServer
- {
- static private $server = '';
- private function __construct()
- {
- }
- /**
- * 创建对象
- * @return JobServer
- */
- static function creatServer()
- {
- if (empty(self::$server)) {
- self::$server = new JobServer();
- }
- return self::$server;
- }
- /**
- * 任务图片处理
- * @param $blockItem
- * @return void
- */
- function broadcastDetectionJob(BlockItems $blockItem){
- BoadcastDetectionJob::dispatch($blockItem)->delay(3)->onConnection('redis')->onQueue('broadcastDetection');
- }
- /**
- * 双线关系绑定
- * @param $mId
- * @param $pId
- */
- function creatBothJob($mId,$pId){
- CreatBothJob::dispatch($mId,$pId)->delay(3)->onConnection('redis')->onQueue('creatBoth');
- }
- }
|