Class AkavacheCacheHandler
- Namespace
- Apizr
- Assembly
- Apizr.Integrations.Akavache.dll
Akavache cache handler implementation
public class AkavacheCacheHandler : ICacheHandler
- Inheritance
-
AkavacheCacheHandler
- Implements
- Inherited Members
Constructors
AkavacheCacheHandler()
Set Akavache as CacheHandler with LocalMachine blob cache and ApizrAkavacheCacheHandler name
public AkavacheCacheHandler()
AkavacheCacheHandler(Func<IBlobCache>)
Set Akavache as CacheHandler with your blob cache and ApizrAkavacheCacheHandler name
public AkavacheCacheHandler(Func<IBlobCache> blobCacheFactory)
Parameters
blobCacheFactoryFunc<IBlobCache>The blob cache factory of your choice
AkavacheCacheHandler(Func<IBlobCache>, string)
Set Akavache as CacheHandler with your blob cache and your provided name
public AkavacheCacheHandler(Func<IBlobCache> blobCacheFactory, string applicationName)
Parameters
blobCacheFactoryFunc<IBlobCache>The blob cache factory of your choice
applicationNamestringThe application name used by Akavache
AkavacheCacheHandler(string)
Set Akavache as CacheHandler with LocalMachine blob cache and your provided name
public AkavacheCacheHandler(string applicationName)
Parameters
applicationNamestringThe application name used by Akavache
Methods
ClearAsync(CancellationToken)
Map Apizr cache clearing method to your cache handler method
public Task ClearAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenAn optional cancellation token
Returns
GetAsync<T>(string, CancellationToken)
Map Apizr cache getting method to your cache handler method
public Task<T> GetAsync<T>(string key, CancellationToken cancellationToken = default)
Parameters
keystringThe key to get from
cancellationTokenCancellationTokenAn optional cancellation token
Returns
- Task<T>
Type Parameters
TThe expected value type
RemoveAsync(string, CancellationToken)
Map Apizr cache removing method to your cache handler method
public Task<bool> RemoveAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringThe key to remove from
cancellationTokenCancellationTokenAn optional cancellation token
Returns
SetAsync(string, object, TimeSpan?, CancellationToken)
Map Apizr cache saving method to your cache handler method
public Task SetAsync(string key, object value, TimeSpan? lifeSpan = null, CancellationToken cancellationToken = default)
Parameters
keystringThe key to cache at
valueobjectThe value to cache
lifeSpanTimeSpan?The optional life span
cancellationTokenCancellationTokenAn optional cancellation token