PHP code example of equip / queue

1. Go to this page and download the library: Download equip/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/ */

    

equip / queue example snippets


// Instantiate Redis
$redis = new Redis;
$redis->connect('127.0.0.1');

// Instantiate the Redis driver
$driver = new Equip\Queue\Driver\RedisDriver($redis);

// Instantiate the event class (which uses league/event)
$emitter = new League\Event\Emitter;
$event = new Equip\Queue\Event($emitter);

// Instantiate the command factory
$injector = new Auryn\Injector;
$factory = new Equip\Queue\Command\AurynCommandFactory($injector);

// Instantiate the Worker class
$worker = new Equip\Queue\Worker($driver, $event, $factory);

// Kick off the consumer
$worker->consume($queue);

// Instantiate Redis
$redis = new Redis;
$redis->connect('127.0.0.1');

// Instantiate the Redis driver
$driver = new Equip\Queue\Driver\RedisDriver($redis);

// Instantiate the Queue class
$queue = new Queue($driver);

$result = $queue->add($queue, Command::class, new Options);