PostSharpAPI ReferencePost­Sharp.​Patterns.​Caching.​ImplementationCache­Invalidator
Open sandboxFocus

CacheInvalidator Class

Base class for a kind of CachingBackendEnhancer that allows several instances of the same application to use a local cache, and synchronize themselves by sending invalidation messages over a publish/subscribe channel.

Implements
IDisposable
Namespace: PostSharp.Patterns.Caching.Implementation
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public abstract class CacheInvalidator : CachingBackendEnhancer

Constructors

Name Description
CacheInvalidator(CachingBackend, CacheInvalidatorOptions)

Initializes a new CachingBackend/

Properties

Name Description
Options

Gets the options of the current CacheInvalidator.

Methods

Name Description
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.

OnMessageReceived(String)

Implementations of CacheInvalidator must call this method when an invalidation message is received.

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.

SendMessageAsync(String, CancellationToken)

Sends an invalidation message over the message bus of the implementation.