1. Go to this page and download the library: Download wangjian/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/ */
wangjian / queue example snippets
is = new Predis\Client([
'schema' => $this->getConfig('QUEUE_REDIS_SCHEMA', 'tcp'),
'host' => $this->getConfig('QUEUE_REDIS_HOST', '127.0.0.1'),
'port' => $this->getConfig('QUEUE_REDIS_PORT', 6379),
'database' => $this->getConfig('QUEUE_REDIS_DATABASE', 0)
]);
$queue = new \Wangjian\Queue\RedisQueue($redis, 'queue');
$queue->push((new \Wangjian\Queue\Job\TestJob()));
= new PDO('mysql:host=mysql;dbname=test', 'root', 'root');
$queue = new \Wangjian\Queue\MysqlQueue($pdo, 'queue');
$queue->push((new \Wangjian\Queue\Job\TestJob()));