PostSharp6.7//API Reference/Post­Sharp.​Patterns.​Caching.​Backends.​Redis Namespace/Redis­Cache­Dependency­Garbage­Collector Class

RedisCacheDependencyGarbageCollector Class

Removes dependencies added when a RedisCachingBackend when items are expired or evicted from the cache. At least one instance (ideally a single instance) of the RedisCacheDependencyGarbageCollector must be running whenever a RedisCachingBackend instance that supports dependencies is running, otherwise the cache will use storage to store dependencies that are no longer relevant, and will not be removed otherwise. If no RedisCacheDependencyGarbageCollector is running while at least one dependency-enabled RedisCachingBackend instance is running, you must initiate full garbage collection by calling the PerformFullCollectionAsync(RedisCachingBackend, CancellationToken) method.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Caching.Backends.Redis.RedisCacheDependencyGarbageCollector

Namespace:  PostSharp.Patterns.Caching.Backends.Redis
Assembly:  PostSharp.Patterns.Caching.Backends.Redis (in PostSharp.Patterns.Caching.Backends.Redis.dll) Version: 6.7.10.0 (6.7.10.0)
Syntax
C#
public sealed class RedisCacheDependencyGarbageCollector : IDisposable

The RedisCacheDependencyGarbageCollector type exposes the following members.

Properties
  NameDescription
Public propertyConnection
Gets the Redis IConnectionMultiplexer used by the current object.
Public propertyDatabase
Gets the Redis IDatabase used by the current object.
Methods
  NameDescription
Public methodStatic memberCreate(CachingBackend)
Creates a new RedisCacheDependencyGarbageCollector that uses an existing DependenciesRedisCachingBackend object.
Public methodStatic memberCreate(IConnectionMultiplexer, RedisCachingBackendConfiguration)
Creates a new RedisCacheDependencyGarbageCollector given a Redis connection and a configuration object.
Public methodStatic memberCreateAsync(CachingBackend, CancellationToken)
Asynchronously creates a new RedisCacheDependencyGarbageCollector that uses an existing RedisCachingBackend object.
Public methodStatic memberCreateAsync(IConnectionMultiplexer, RedisCachingBackendConfiguration, CancellationToken)
Asynchronously creates a new RedisCacheDependencyGarbageCollector given a Redis connection and a configuration object.
Public methodDispose
Disposes the current object.
Public methodDisposeAsync
Asynchronously disposes the current object.
Public methodStatic memberPerformFullCollectionAsync(RedisCachingBackend, CancellationToken)
Performs a full garbage collection on all Redis servers. This operation enumerates and validates all keys in the database, and can possibly last several minutes and affect performance in production.
Public methodStatic memberPerformFullCollectionAsync(RedisCachingBackend, IServer, CancellationToken)
Performs a full garbage collection on a given Redis server. This operation enumerates and validates all keys in the database, and can possibly last several minutes and affect performance in production.
See Also