PostSharpAPI ReferencePost­Sharp.​Patterns.​Caching.​Backends.​RedisRedis­Cache­Dependency­Garbage­Collector
Open sandboxFocus

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
RedisCacheDependencyGarbageCollector
Implements
IDisposable
Namespace: PostSharp.Patterns.Caching.Backends.Redis
Assembly: PostSharp.Patterns.Caching.Backends.Redis.dll
Syntax
public sealed class RedisCacheDependencyGarbageCollector : Object

Properties

Name Description
Connection

Gets the Redis StackExchange.Redis.IConnectionMultiplexer used by the current object.

Database

Gets the Redis StackExchange.Redis.IDatabase used by the current object.

Methods

Name Description
Create(CachingBackend)

Creates a new RedisCacheDependencyGarbageCollector that uses an existing PostSharp.Patterns.Caching.Backends.Redis.DependenciesRedisCachingBackend object.

Create(IConnectionMultiplexer, RedisCachingBackendConfiguration)

Creates a new RedisCacheDependencyGarbageCollector given a Redis connection and a configuration object.

CreateAsync(CachingBackend, CancellationToken)

Asynchronously creates a new RedisCacheDependencyGarbageCollector that uses an existing RedisCachingBackend object.

CreateAsync(IConnectionMultiplexer, RedisCachingBackendConfiguration, CancellationToken)

Asynchronously creates a new RedisCacheDependencyGarbageCollector given a Redis connection and a configuration object.

Dispose()

Disposes the current object.

DisposeAsync(CancellationToken)

Asynchronously disposes the current object.

PerformFullCollectionAsync(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.

PerformFullCollectionAsync(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.