1. Go to this page and download the library: Download ysandreew/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/ */
ysandreew / queue example snippets
use Predis\Client;
use Ysandreew\Queue\Queue;
$redis = new Client([
'scheme' => 'tcp',
'host' => '127.0.0.1',
'port' => 6379,
'password'=>'password'
]);
$queue=new Queue('test',$redis);
namespace App;
use Monolog\Logger;
use Ysandreew\Queue\Job;
class TestJob extends Job {
public $name;
public $logger;
public function run()
{
$this->logger->info("My Name is {$this->name}");
}
public function __construct(string $name,Logger $logger)
{
$this->name=$name;
$this->logger=$logger;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.