12345678910111213141516171819202122232425262728293031323334 |
- <?php
- declare(strict_types=1);
- namespace App\Service;
- use App\Job\GatherExampleJob;
- use Hyperf\AsyncQueue\Driver\DriverFactory;
- use Hyperf\AsyncQueue\Driver\DriverInterface;
- class GatherQueueService
- {
- protected DriverInterface $driver;
- public function __construct(DriverFactory $driverFactory)
- {
- $this->driver = $driverFactory->get('default');
- }
-
- public function push($params, int $delay = 0): bool
- {
-
-
-
- return $this->driver->push(new GatherExampleJob($params), $delay);
- }
- }
|