aztech/event-bus-extra-redis

There is no license information available for the latest version (v1.1.5) of this package.

aztech/event-bus Redis channel provider

v1.1.5 2015-01-27 23:08 UTC

This package is not auto-updated.

Last update: 2024-11-19 04:13:57 UTC


README

Build status

Build Status Code Coverage Scrutinizer Quality Score Dependency Status HHVM Status

Stability

Latest Stable Version Latest Unstable Version

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.