1. Go to this page and download the library: Download spiral/roadrunner-jobs 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/ */
spiral / roadrunner-jobs example snippets
use Spiral\RoadRunner\Jobs\Jobs;
use Spiral\Goridge\RPC\RPC;
));
// Select "local" pipeline from jobs
$queue = $jobs->connect('local');
// Create task prototype with default headers
$task = $queue->create('ping', '{"site": "https://example.com"}') // Create task with "echo" name
->withHeader('attempts', 4) // Number of attempts to execute the task
->withHeader('retry-delay', 10); // Delay between attempts
// Push "echo" task to the queue
$task = $queue->dispatch($task);
var_dump($task->getId() . ' has been queued');