Class RedisCacheBackplane
Implementation of the cache backplane using a Redis Pub/Sub channel.
Redis Pub/Sub is used to send messages to the redis server on any key change, cache clear, region clear or key remove operation. Every cache manager with the same configuration subscribes to the same channel and can react on those messages to keep other cache handles in sync with the 'master'.
Inherited Members
Namespace:CacheManager.Redis
Assembly:CacheManager.StackExchange.Redis.dll
Syntax
public sealed class RedisCacheBackplane : CacheBackplane, IDisposable
Remarks
The cache manager must have at least one cache handle configured with IsBackplaneSource set to true
.
Usually this is the redis cache handle, if configured. It should be the distributed and bottom most cache handle.
Constructors
| Improve this Doc View SourceRedisCacheBackplane(ICacheManagerConfiguration, ILoggerFactory)
Initializes a new instance of the RedisCacheBackplane class.
Declaration
public RedisCacheBackplane(ICacheManagerConfiguration configuration, ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
ICacheManagerConfiguration | configuration | The cache manager configuration. |
ILoggerFactory | loggerFactory | The logger factory |
Methods
| Improve this Doc View SourceDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected override void Dispose(bool managed)
Parameters
Type | Name | Description |
---|---|---|
Boolean | managed |
|
Overrides
| Improve this Doc View SourceNotifyChange(String, CacheItemChangedEventAction)
Notifies other cache clients about a changed cache key.
Declaration
public override void NotifyChange(string key, CacheItemChangedEventAction action)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
CacheItemChangedEventAction | action | The cache action. |
Overrides
| Improve this Doc View SourceNotifyChange(String, String, CacheItemChangedEventAction)
Notifies other cache clients about a changed cache key.
Declaration
public override void NotifyChange(string key, string region, CacheItemChangedEventAction action)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
String | region | The region. |
CacheItemChangedEventAction | action | The cache action. |
Overrides
| Improve this Doc View SourceNotifyClear()
Notifies other cache clients about a cache clear.
Declaration
public override void NotifyClear()
Overrides
| Improve this Doc View SourceNotifyClearRegion(String)
Notifies other cache clients about a cache clear region call.
Declaration
public override void NotifyClearRegion(string region)
Parameters
Type | Name | Description |
---|---|---|
String | region | The region. |
Overrides
| Improve this Doc View SourceNotifyRemove(String)
Notifies other cache clients about a removed cache key.
Declaration
public override void NotifyRemove(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
Overrides
| Improve this Doc View SourceNotifyRemove(String, String)
Notifies other cache clients about a removed cache key.
Declaration
public override void NotifyRemove(string key, string region)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key. |
String | region | The region. |