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
cacheCache<TKey, TValue>The cache that will push read-through events.
asyncValueFactoryFunc<TKey, Task<ValueFactoryResult<TValue>>>Callback that returns an object to be stored in the ScaleOut service.
Type Parameters
TKeyThe type of keys in the cache.
TValueThe 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
cacheCache<TKey, TValue>The cache that will push read-through events.
valueFactoryFunc<TKey, ValueFactoryResult<TValue>>Callback that returns an object to be stored in the ScaleOut service.
Type Parameters
TKeyThe type of keys in the cache.
TValueThe type of values in the cache.