Interface ILocalCacheEntryReference
- Namespace
- Acuit.Pinpoint.ResourceManagement
- Assembly
- Acuit.Pinpoint.ResourceManagement.Abstractions.dll
A reference to a persistent local resource cache entry.
public interface ILocalCacheEntryReference : IDisposable
- Inherited Members
Methods
GetCachedValueAsync(CancellationToken)
Gets the cached object, if it exists.
Task<CachedEntry> GetCachedValueAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA cancellation token that can be used to cancel retrieving the cached value.
Returns
- Task<CachedEntry>
A task that represents the asynchronous operation. The value of its Result property contains an CachedEntry representing the object retrieved from the cache, if it exists, or null if it does not.
Remarks
Note that each call will deserialize the object from the cache, so the object instance returned from this method will never be the same instance as returned by previous calls to this method or as supplied to SetCachedValueAsync(object, CancellationToken).
SetCachedValueAsync(object, CancellationToken)
Sets the cached object value.
Task SetCachedValueAsync(object value, CancellationToken cancellationToken = default)
Parameters
value
objectThe object value.
cancellationToken
CancellationTokenA cancellation token that can be used to cancel setting the cached value.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- SerializationException
The
value
type cannot be serialized.