aztech / event-bus-extra-redis
aztech/event-bus Redis channel provider
Requires
- aztech/event-bus: ~1.1.1
- aztech/php-utils: ~1
- predis/predis: ~1.0
- psr/log: ~1.0
Requires (Dev)
- phpmd/phpmd: ~2.1
- phpunit/phpunit: ~4.2
- squizlabs/php_codesniffer: ~1.5
- vektah/bugfree-dangerzone: ~0.2
README
Build status
Stability
About
Redis database plugin for the aztech/event-bus
library. For more information on event-bus
, see that library's readme.
Installation
Via Composer
Composer is the only supported way of installing aztech/event-bus-extra-redis . Don't know Composer yet ? Read more about it.
$ composer require "aztech/event-bus-extra-redis":"~1"
Usage
To use this plugin, you first need to register it with the Event factory. The easiest way is as follows :
<?php require_once 'vendor/autoload.php'; use \Aztech\Events\Events; use \Aztech\Events\Bus\Plugins\Redis\Redis; Redis::loadPlugin('redis'); $publisher = Events::createPublisher('redis'); $processor = Events::createProcessor('redis'); // ...
Configuring
By default, the plugin attempts to connect to a Redis server at localhost:6379, which suits mostly development machines.
You can configure the Redis client using the options array when using the Event factory.
<?php require_once 'vendor/autoload.php'; use \Aztech\Events\Events; use \Aztech\Events\Bus\Plugins\Redis\Redis; Redis::loadPlugin('redis'); $publisher = Events::createPublisher('redis', [ 'host' => '192.168.1.1', 'port' => 6379); // ...
The keenest readers will have noticed the options accepted are the same as those used by \Predis\Client
.