ThreadSafeCacheFactoryCreateTKey, TValue(FuncTKey, TValue, ThreadSafeCacheOptionsBase) Method
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static IThreadSafeCacheAccessor<TKey, TValue> Create<TKey, TValue>(
Func<TKey, TValue> itemLoader,
ThreadSafeCacheOptionsBase? options = null
)
Public Shared Function Create(Of TKey, TValue) (
itemLoader As Func(Of TKey, TValue),
Optional options As ThreadSafeCacheOptionsBase = Nothing
) As IThreadSafeCacheAccessor(Of TKey, TValue)
public:
generic<typename TKey, typename TValue>
static IThreadSafeCacheAccessor<TKey, TValue>^ Create(
Func<TKey, TValue>^ itemLoader,
ThreadSafeCacheOptionsBase^ options = nullptr
)
static member Create :
itemLoader : Func<'TKey, 'TValue> *
?options : ThreadSafeCacheOptionsBase
(* Defaults:
let _options = defaultArg options null
*)
-> IThreadSafeCacheAccessor<'TKey, 'TValue>
- itemLoader FuncTKey, TValue
- A delegate for loading a value, which is invoked when a key is not present in the cache.
- options ThreadSafeCacheOptionsBase (Optional)
- The options for creating the cache. If , then a default LockFreeCacheOptions instance will be used. This parameter is optional.
Default value: .
- TKey
- The type of the key in the cache.
- TValue
- The type of the value in the cache.
IThreadSafeCacheAccessorTKey,
TValueAn
IThreadSafeCacheAccessorTKey, TValue instance that can be used to read the underlying cache in a thread-safe manner.