Skip to main content

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
TypeName
System.String[]readWriteHosts

FailoverTo(IEnumerable<String>, IEnumerable<String>)

View Source
Declaration
public void FailoverTo(IEnumerable<string> readWriteHosts, IEnumerable<string> readOnlyHosts)
Parameters
TypeName
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
TypeName
ServiceStack.Redis.RedisNativeClientclient

DisposeWriteClient(RedisNativeClient)

Disposes the write client.

View Source
Declaration
public void DisposeWriteClient(RedisNativeClient client)
Parameters
TypeNameDescription
ServiceStack.Redis.RedisNativeClientclientThe 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
TypeName
System.Booleandisposing

Dispose(RedisClient)

View Source
Declaration
protected void Dispose(RedisClient redisClient)
Parameters
TypeName
ServiceStack.Redis.RedisClientredisClient

GetCacheClient()

View Source
Declaration
public ICacheClient GetCacheClient()
Returns

ServiceStack.Caching.ICacheClient

GetReadOnlyCacheClient()

View Source
Declaration
public ICacheClient GetReadOnlyCacheClient()
Returns

ServiceStack.Caching.ICacheClient

Implements