1. Go to this page and download the library: Download goletter/hyperf-queue library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use App\Job\SendLetterJob;
use Goletter\Queue\Queue;
use Goletter\Server\Service\QueueService;
use function Goletter\Queue\dispatch_ms;
use function Hyperf\AsyncQueue\dispatch;
$job = new SendLetterJob(...);
// official second-based pool (delay = seconds)
dispatch($job);
dispatch($job, 5);
$queueService->push($job, 'default', 5); // 5 seconds
// millisecond pool (delay = milliseconds)
$queueService->push($job, 'ms', 10); // 10ms
$queueService->push($job, 'ms', 200); // 200ms
Queue::laterMs(150, $job);
dispatch_ms($job, 150);