Skip to content

Commit c076598

Browse files
author
Anton
authored
Update redis.md
Updated example for setup custom options of PRedis provider
1 parent 35b15fc commit c076598

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Diff for: docs/transport/redis.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ $connectionFactory = new RedisConnectionFactory([
107107
$context = $connectionFactory->createContext();
108108
```
109109

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

112112
It gives you more control over vendor specific features.
113113

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

119-
$config = [];
120-
$options = [];
119+
$config = [
120+
'host' => 'localhost',
121+
'port' => 6379,
122+
'predis_options' => [
123+
'prefix' => 'ns:'
124+
]
125+
];
121126

122-
$redis = new PRedis(new \PRedis\Client($config, $options));
127+
$redis = new PRedis($config);
123128

124129
$factory = new RedisConnectionFactory($redis);
125130
```

0 commit comments

Comments
 (0)