You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 24, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+27-23Lines changed: 27 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,38 +75,43 @@ Any additional configuration can be specified as QueryString parameters. The ful
75
75
76
76
## Redis Client Managers
77
77
78
-
The recommended way to access the RedisClientis to use one of the available Client Managers:
78
+
The recommended way to access `RedisClient` instances is to use one of the available Thread-Safe Client Managers below. Client Managers are connection factories which is ideally registered as a Singleton either in your IOC or static classes.
79
79
80
-
#### `RedisManagerPool`
80
+
#### RedisManagerPool
81
81
82
-
With the enhanced Redis URI Connection Strings we've been able to simplify and streamline the existing `PooledRedisClientManager`
83
-
implementation that's been extracted out into a new clients manager called `RedisManagerPool`.
82
+
With the enhanced Redis URI Connection Strings we've been able to simplify and streamline the existing `PooledRedisClientManager` implementation and have extracted it out into a new clients manager called `RedisManagerPool`.
84
83
85
-
In addition to removing all above options on the Client Manager itself, we've also removed readonly connection strings so the configuration
86
-
ends up much simpler and more aligned with the common use-case:
84
+
In addition to removing all above options on the Client Manager itself, readonly connection strings have also been removed so the configuration ends up much simpler and more aligned with the common use-case:
87
85
88
86
```csharp
89
87
container.Register<IRedisClientsManager>(c=>
90
88
newRedisManagerPool(redisConnectionString));
91
89
```
92
90
93
-
#### `PooledRedisClientManager`
91
+
**Pooling Behavior**
92
+
93
+
Any connections required after the maximum Pool size has been reached will be created and disposed outside of the Pool. By not being restricted to a maximum pool size, the pooling behavior in `RedisManagerPool` can maintain a smaller connection pool size at the cost of potentially having a higher opened/closed connection count.
94
+
95
+
#### PooledRedisClientManager
94
96
95
97
If you prefer to define options on the Client Manager itself or you want to provide separate Read/Write and ReadOnly
96
98
(i.e. Master and Slave) redis-servers, use the `PooledRedisClientManager` instead:
If don't want to use connection pooling (i.e. your accessing a local redis-server instance)
109
-
you can use a basic (non-pooled) Clients Manager:
110
+
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.
111
+
112
+
#### BasicRedisClientManager
113
+
114
+
If don't want to use connection pooling (i.e. your accessing a local redis-server instance) you can use a basic (non-pooled) Clients Manager which creates a new `RedisClient` instance each time:
110
115
111
116
```csharp
112
117
container.Register<IRedisClientsManager>(c=>
@@ -119,27 +124,26 @@ Once registered, accessing the RedisClient is the same in all Client Managers, e
0 commit comments