Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 3.14 KB

File metadata and controls

65 lines (40 loc) · 3.14 KB

RedisAdminCache Class

!!! IMPORTANT !!! This class is only intended to be used as a singleton because we construct the
multiplexer in our constructor, and constructing multiplexers is expensive.

We have to use an instance created via DI instead of a static class because we need to be able
inject Configuration to have access to the connection string.

public class RedisAdminCache : Sagara.Core.Caching.RedisCache

Inheritance System.Object 🡒 RedisCache 🡒 RedisAdminCache

Remarks

NOTE: Be sure to set abortConnect=false in the connection string so that we gracefully handle connection failures.

Constructors

RedisAdminCache(ILogger, string) Constructor

!!! IMPORTANT !!! This class is only intended to be used as a singleton because we construct the
multiplexer in our constructor, and constructing multiplexers is expensive.

We have to use an instance created via DI instead of a static class because we need to be able
inject Configuration to have access to the connection string.

public RedisAdminCache(Microsoft.Extensions.Logging.ILogger<Sagara.Core.Caching.RedisAdminCache> logger, string connectionString);

Parameters

logger Microsoft.Extensions.Logging.ILogger<RedisAdminCache>

connectionString System.String

Remarks

Same as RedisCache, but it supports protected operations, such as FLUSH.

NOTE: Be sure to set abortConnect=false in the connection string so that we gracefully handle connection failures.

Methods

RedisAdminCache.FlushAllAsync() Method

Delete all the keys of all databases on the server.

public System.Threading.Tasks.Task FlushAllAsync();

Returns

System.Threading.Tasks.Task