- Redis
Missing the driver you want? Create it!
// 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);
Here's an example consumer
// 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);
Here's an example producer
$result = $queue->add($queue, Command::class, new Options);
A boolean ($result
) is returned which contains the status of the push onto the queue.
Creating a driver is as simple as implementing the DriverInterface.