Method SetLoadObjectHandler
SetLoadObjectHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, Task<ValueFactoryResult<TValue>>>)
Sets an async callback method for handling read-through or refresh-ahead events. The object returned from the callback is loaded into the ScaleOut service.
public static void SetLoadObjectHandler<TKey, TValue>(Cache<TKey, TValue> cache, Func<TKey, Task<ValueFactoryResult<TValue>>> asyncValueFactory)
Parameters
cache
Cache<TKey, TValue>The cache that will push read-through events.
asyncValueFactory
Func<TKey, Task<ValueFactoryResult<TValue>>>Callback that returns an object to be stored in the ScaleOut service.
Type Parameters
TKey
The type of keys in the cache.
TValue
The type of values in the cache.
SetLoadObjectHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, ValueFactoryResult<TValue>>)
Sets a callback method for handling read-through or refresh-ahead events. The object returned from the callback is loaded into the ScaleOut service.
public static void SetLoadObjectHandler<TKey, TValue>(Cache<TKey, TValue> cache, Func<TKey, ValueFactoryResult<TValue>> valueFactory)
Parameters
cache
Cache<TKey, TValue>The cache that will push read-through events.
valueFactory
Func<TKey, ValueFactoryResult<TValue>>Callback that returns an object to be stored in the ScaleOut service.
Type Parameters
TKey
The type of keys in the cache.
TValue
The type of values in the cache.