A CachingBackend for Redis, based on the StackExchange.Redis client.
Implements
Namespace: PostSharp.Patterns.Caching.Backends.Redis
Assembly: PostSharp.Patterns.Caching.Backends.Redis.dll
Syntax
public class RedisCachingBackend : CachingBackend, IDisposableFields
| Name | Description |
|---|---|
| SchemaVersion | Gets the version of the data schema used by RedisCachingBackend. |
Properties
| Name | Description |
|---|---|
| Configuration | Gets the configuration of the current RedisCachingBackend. |
| Connection | Gets the Redis connection used by the current RedisCachingBackend. |
| Database | Gets the Redis database used by the current RedisCachingBackend. |
| IsBackgroundTaskQueueOverloaded | Gets a value indicating whether the queue of background tasks is overloaded, i.e. it contains more tasks than the value of the BackgroundTasksOverloadedThreshold property. Clients can observe this property and react by reducing load or signaling a monitoring alert. |
Methods
| Name | Description |
|---|---|
| ClearAsyncCore(CancellationToken) | Asynchronously clears the cache. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. |
| ClearCore() | Clears the cache. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. |
| ContainsDependencyCore(string) | Determines whether the cache contains a given dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| ContainsItemAsyncCore(string, CancellationToken) | Asynchronously determines whether the cache contains an item of a given key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| ContainsItemCore(string) | Determines whether the cache contains an item of a given key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| Create(IConnectionMultiplexer, RedisCachingBackendConfiguration) | Creates a new RedisCachingBackend. |
| CreateAsync(IConnectionMultiplexer, RedisCachingBackendConfiguration, CancellationToken) | Asynchronously creates a new RedisCachingBackend. |
| CreateFeatures() | Creates a CachingBackendFeatures object, which describes set of features implemented by the back-end. This method is invoked the first time the SupportedFeatures property is evaluated. The result is then cached. |
| DisposeAsyncCore(CancellationToken) | Asynchronously disposes the current CachingBackend. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. |
| DisposeCore(bool) | Synchronously disposes the current CachingBackend. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. |
| ExecuteSync(Func<CancellationToken, Task>) | Executes an asynchronous method synchronously (no return value). |
| ExecuteSync<T>(Func<CancellationToken, Task<T>>) | Executes an asynchronous method synchronously (with return value). |
| ~RedisCachingBackend() | Destructor. |
| InvalidateDependencyAsyncCore(string, CancellationToken) | Asynchronously removes from the cache all items that have a specific dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| InvalidateDependencyCore(string) | Removes from the cache all items that have a specific dependency. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| ProcessEvent(string, string, Guid) | Processes an event that was received on the events channel. |
| RemoveItemAsyncCore(string, CancellationToken) | Asynchronously removes a cache item from the cache given its key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| RemoveItemCore(string) | Removes a cache item from the cache given its key. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| SetItemAsyncCore(string, CacheItem, CancellationToken) | Asynchronously sets a cache item. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. The default implementation is to call the synchronous SetItemCore(string, CacheItem) method. |
| SetItemCore(string, CacheItem) | Sets a cache item. This protected method is part of the implementation API and is meant to be overridden in user code, not invoked. Arguments are already validated by the consumer API. |
| WhenBackgroundTasksCompleted(CancellationToken) | Returns a Task that is signaled to the complete state when all background tasks have completed. |
Events
| Name | Description |
|---|---|
| IsBackgroundTaskQueueOverloadedChanged | Event raised when the IsBackgroundTaskQueueOverloaded property has changed. |