Open sandboxFocus

Class CacheInvalidator

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
Namespace: PostSharp.Patterns.Caching.Implementation
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public abstract class CacheInvalidator : CachingBackendEnhancer, IDisposable

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.