PHP code example of equip / redis-queue
1. Go to this page and download the library: Download equip/redis-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 / redis-queue example snippets
namespace Acme;
use Acme\Command\FooCommand;
use Equip\Adr\DomainInterface;
use Equip\RedisQueue\Publisher;
class FooDomain implements DomainInterface
{
private $publisher;
public function __construct(Publisher $publisher)
{
$this->publisher = $publisher;
}
public function __invoke(array $input)
{
// ...
$command_options = ['foo' => 'bar'];
$this->publisher->publish(
'queue_name',
FooCommand::class,
$command_options
);
}
}