Skip to content

Commit

Permalink
Update redis.md
Browse files Browse the repository at this point in the history
Updated example for setup custom options of PRedis provider
  • Loading branch information
Anton authored Jan 15, 2019
1 parent 35b15fc commit c076598
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/transport/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ $connectionFactory = new RedisConnectionFactory([
$context = $connectionFactory->createContext();
```

* With custom redis instance:
* With predis and custom [options](https://github.com/nrk/predis/wiki/Client-Options):

It gives you more control over vendor specific features.

Expand All @@ -116,10 +116,15 @@ It gives you more control over vendor specific features.
use Enqueue\Redis\RedisConnectionFactory;
use Enqueue\Redis\PRedis;

$config = [];
$options = [];
$config = [
'host' => 'localhost',
'port' => 6379,
'predis_options' => [
'prefix' => 'ns:'
]
];

$redis = new PRedis(new \PRedis\Client($config, $options));
$redis = new PRedis($config);

$factory = new RedisConnectionFactory($redis);
```
Expand Down

0 comments on commit c076598

Please sign in to comment.