Open sandboxFocus

Class CacheCleanupOptions

Inheritance
CacheCleanupOptions
Namespace: PostSharp.Patterns.Caching.Implementation
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public sealed class CacheCleanupOptions
Remarks

Of the built-in backends, only the Redis backend with dependencies enabled implements the cleanup. These options apply both when you call CleanUpAsync(CacheCleanupOptions, CancellationToken) and to the periodic cleanup of RedisCacheDependencyGarbageCollector, which takes them from its own options.

The Default options process keys without delay and with a concurrency of 20, which favors cleanup speed and can overload a production server. On a production database, set a non-zero WaitDelay and a lower MaxConcurrency.

Constructors

Name Description
CacheCleanupOptions()

Properties

Name Description
Default

Gets the default options.

Dry

Gets or sets a value indicating whether the CleanUpAsync(CacheCleanupOptions, CancellationToken) method should report errors but not attempt to fix them.

MaxConcurrency

Gets or sets the maximum number of keys being analyzed and cleaned up concurrently. The default value is 20.

RemediationDelay

Gets or sets the delay between the moment an inconsistency is detected and the moment a remediation is attempted. The default value is 10 seconds.

Sequential

Gets or sets a value indicating whether the CleanUpAsync(CacheCleanupOptions, CancellationToken) method should process items sequentially. By default, it processes them concurrently.

WaitDelay

Gets or sets the delay between the processing of two keys. The default value is 0.

See Also