PHP code example of vanilla / garden-message-queue
1. Go to this page and download the library: Download vanilla/garden-message-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/ */
vanilla / garden-message-queue example snippets
/* @var $jobQueue \Garden\MessageQueue\JobQueue */
$jobQueue = Gdn::getContainer()->get('JobQueue');
// Schedules a job
$job = $jobQueue->addJob(EchoJob::class, ['message' => 'Hello World!']);
echo "EchoJob was scheduled with ID: " . $job->getID() . " and status: " . $job->getStatus();