| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Module\DelayQueue\Job;
- use App\Module\DelayQueue\Entity\Queue;
- use App\Module\DelayQueue\Redis;
- use UCore\Queue\QueueJob;
- class DelayQueueJob extends QueueJob
- {
- public function __construct(public Queue $arg)
- {
- }
- public function run(): bool
- {
- $key =Redis::getkey([$this->arg->runClass,$this->arg->runMethod],$this->arg->runParam);
- /**
- * @var \Redis $a
- */
- $a = \Illuminate\Support\Facades\Redis::client();
- $a->del($key);
- // dump($this->arg,[$this->arg->runClass,$this->arg->runMethod]);
- $res = call_user_func([$this->arg->runClass,$this->arg->runMethod],$this->arg->runParam);
- // dump($res);
- return true;
- }
- public function payload()
- {
- return $this->arg;
- }
- }
|