Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Cache.CacheDistributed Class Reference

Accessing cache distributed only More...

Inheritance diagram for Sphyrnidae.Common.Cache.CacheDistributed:
Sphyrnidae.Common.Cache.ICache

Public Member Functions

 CacheDistributed (DefaultCacheOptions options, IDistributedCache l2Cache, IEnvironmentSettings env, ISignalR signalR)
 
virtual bool Get< T > (string key, out T item)
 Retrieves an item from the Cache More...
 
virtual void Set< T > (string key, T item)
 Sets an item into cache More...
 
virtual T Get< T > (string key, Func< T > method)
 Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use More...
 
virtual Task< T > GetAsync< T > (string key, Func< Task< T >> method)
 Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use More...
 
virtual void Remove (string key)
 Removes the given object from distributed cache More...
 
virtual Task< Exception > RemoveAsync (string key)
 Removes the given object from distributed cache More...
 

Properties

CacheOptions Options [get]
 
IDistributedCache L2Cache [get]
 
IEnvironmentSettings Env [get]
 
ISignalR SignalR [get]
 
- Properties inherited from Sphyrnidae.Common.Cache.ICache
CacheOptions Options [get]
 The options for storing items in cache More...
 

Detailed Description

Accessing cache distributed only

Constructor & Destructor Documentation

◆ CacheDistributed()

Sphyrnidae.Common.Cache.CacheDistributed.CacheDistributed ( DefaultCacheOptions  options,
IDistributedCache  l2Cache,
IEnvironmentSettings  env,
ISignalR  signalR 
)

Member Function Documentation

◆ Get< T >() [1/2]

virtual T Sphyrnidae.Common.Cache.CacheDistributed.Get< T > ( string  key,
Func< T >  method 
)
virtual

Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use

Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
methodThe callback function returning the item if not initially found in cache
Returns
The object from cache/callback function

Implements Sphyrnidae.Common.Cache.ICache.

◆ Get< T >() [2/2]

virtual bool Sphyrnidae.Common.Cache.CacheDistributed.Get< T > ( string  key,
out T  item 
)
virtual

Retrieves an item from the Cache

Retrieves an item from the Cache

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
itemIf the object is not found in the Cache, this will be populated
Returns
True if the object was found, False if not found

Implements Sphyrnidae.Common.Cache.ICache.

◆ GetAsync< T >()

virtual Task<T> Sphyrnidae.Common.Cache.CacheDistributed.GetAsync< T > ( string  key,
Func< Task< T >>  method 
)
virtual

Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use

Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
methodThe callback function returning the item if not initially found in cache
Returns
The object from cache/callback function

Implements Sphyrnidae.Common.Cache.ICache.

◆ Remove()

virtual void Sphyrnidae.Common.Cache.CacheDistributed.Remove ( string  key)
virtual

Removes the given object from distributed cache

Removes the given object from cache

Any failures will be hidden from the caller (Exceptions will not be thrown out)

Parameters
keyName of the item in cache

Implements Sphyrnidae.Common.Cache.ICache.

◆ RemoveAsync()

virtual Task<Exception> Sphyrnidae.Common.Cache.CacheDistributed.RemoveAsync ( string  key)
virtual

Removes the given object from distributed cache

Removes the given object from cache

Parameters
keyName of the item in cache
Returns
If an exception was thrown and the item was not fully removed, this exception will be returned. If everything succeeded, this will be null.

Implements Sphyrnidae.Common.Cache.ICache.

◆ Set< T >()

virtual void Sphyrnidae.Common.Cache.CacheDistributed.Set< T > ( string  key,
item 
)
virtual

Sets an item into cache

Sets an item into cache

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
itemThe item being set into cache

Implements Sphyrnidae.Common.Cache.ICache.

Property Documentation

◆ Env

IEnvironmentSettings Sphyrnidae.Common.Cache.CacheDistributed.Env
getprotected

◆ L2Cache

IDistributedCache Sphyrnidae.Common.Cache.CacheDistributed.L2Cache
getprotected

◆ Options

CacheOptions Sphyrnidae.Common.Cache.CacheDistributed.Options
get

◆ SignalR

ISignalR Sphyrnidae.Common.Cache.CacheDistributed.SignalR
getprotected

The documentation for this class was generated from the following file: