Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 51f1d22

Browse files
committed
Update README.md
1 parent 8248859 commit 51f1d22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ container.Register<IRedisClientsManager>(c =>
155155

156156
The `PooledRedisClientManager` imposes a maximum connection limit and when its maximum pool size has been reached will instead block on any new connection requests until the next `RedisClient` is released back into the pool. If no client became available within `PoolTimeout`, a Pool `TimeoutException` will be thrown.
157157

158+
#### Read Only Clients
159+
160+
By default resolving a RedisClient with `GetRedisClient()` or `GetRedisClientAsync()` will return a client connected to the configured primary (master) host, if you also have replica (slave) hosts configured, you can access it with the `GetReadOnlyClient()` or `GetReadOnlyClientAsync()` APIs, e.g:
161+
162+
```csharp
163+
using var redisReadOnly = clientsManager.GetReadOnlyClient();
164+
```
165+
158166
### BasicRedisClientManager
159167

160168
If don't want to use connection pooling (i.e. you're accessing a local redis-server instance) you can use a basic (non-pooled) Clients Manager which creates a new `RedisClient` instance each time:

0 commit comments

Comments
 (0)