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