RedisManagerPool
Provides thread-safe pooling of redis client connections. All connections are treated as read and write hosts.
Assembly: ServiceStack.Redis.dll
View Source
Declaration
public class RedisManagerPool : IRedisClientsManagerAsync, IRedisClientsManager, IRedisFailover, IHandleClientDispose, IHasRedisResolver, IRedisClientCacheManager, IDisposable, IHasStats
Properties
OnFailover
View Source
Declaration
public List<Action<IRedisClientsManager>> OnFailover { get; }
ClientFactory
View Source
Declaration
public Func<RedisEndpoint, RedisClient> ClientFactory { get; set; }
ConnectionFilter
View Source
Declaration
public Action<IRedisNativeClient> ConnectionFilter { get; set; }
RedisResolver
View Source
Declaration
public IRedisResolver RedisResolver { get; set; }
MaxPoolSize
View Source
Declaration
public int MaxPoolSize { get; }
AssertAccessOnlyOnSameThread
View Source
Declaration
public bool AssertAccessOnlyOnSameThread { get; set; }
Stats
View Source
Declaration
public Dictionary<string, long> Stats { get; }
Fields
RecheckPoolAfterMs
View Source
Declaration
public int RecheckPoolAfterMs
poolIndex
View Source
Declaration
protected int poolIndex
RedisClientCounter
View Source
Declaration
protected int RedisClientCounter
Methods
FailoverTo(String[])
View Source
Declaration
public void FailoverTo(params string[] readWriteHosts)
Parameters
Type | Name |
---|---|
System.String[] | readWriteHosts |
FailoverTo(IEnumerable<String>, IEnumerable<String>)
View Source
Declaration
public void FailoverTo(IEnumerable<string> readWriteHosts, IEnumerable<string> readOnlyHosts)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.String> | readWriteHosts |
System.Collections.Generic.IEnumerable<System.String> | readOnlyHosts |
GetClient()
Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts
View Source
Declaration
public IRedisClient GetClient()
Returns
ServiceStack.Redis.IRedisClient
GetReadOnlyClient()
View Source
Declaration
public IRedisClient GetReadOnlyClient()
Returns
ServiceStack.Redis.IRedisClient
DisposeClient(RedisNativeClient)
View Source
Declaration
public void DisposeClient(RedisNativeClient client)
Parameters
Type | Name |
---|---|
ServiceStack.Redis.RedisNativeClient | client |
DisposeWriteClient(RedisNativeClient)
Disposes the write client.
View Source
Declaration
public void DisposeWriteClient(RedisNativeClient client)
Parameters
Type | Name | Description |
---|---|---|
ServiceStack.Redis.RedisNativeClient | client | The client. |
|
GetStats()
View Source
Declaration
public Dictionary<string, string> GetStats()
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
GetClientPoolActiveStates()
View Source
Declaration
public int[] GetClientPoolActiveStates()
Returns
System.Int32[]
Finalize()
View Source
Declaration
protected void Finalize()
Dispose()
View Source
Declaration
public void Dispose()
Dispose(Boolean)
View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
Dispose(RedisClient)
View Source
Declaration
protected void Dispose(RedisClient redisClient)
Parameters
Type | Name |
---|---|
ServiceStack.Redis.RedisClient | redisClient |
GetCacheClient()
View Source
Declaration
public ICacheClient GetCacheClient()
Returns
ServiceStack.Caching.ICacheClient
GetReadOnlyCacheClient()
View Source
Declaration
public ICacheClient GetReadOnlyCacheClient()
Returns
ServiceStack.Caching.ICacheClient