using Microsoft.Extensions.Caching.Memory;
|
using System;
|
using System.Collections.Concurrent;
|
|
namespace IStation.ChEr
|
{
|
/// <summary>
|
/// 待编写
|
/// </summary>
|
internal sealed partial class SharedMemoryCache : IMemoryCacheDirect
|
{
|
/// <summary>
|
/// 单例模式(延迟加载)
|
/// </summary>
|
private static readonly Lazy<SharedMemoryCache> _lazy = new Lazy<SharedMemoryCache>(() => new SharedMemoryCache());
|
|
/// <summary>
|
/// MemoryCache 实例
|
/// </summary>
|
private MemoryCache _memoryCache;
|
|
/// <summary>
|
/// 当前正在设置缓存项的缓存键集合
|
/// Collection of all cache keys currently executing a function to set a cache item
|
/// </summary>
|
private ConcurrentDictionary<string, CacheKeyBeingHandled> _cacheKeysBeingHandled;
|
|
/// <summary>
|
/// Locker object
|
/// </summary>
|
private object _wipeLock = new object();
|
|
/// <summary>
|
/// 标识Wipe方法是否正在执行
|
/// State flag indicating whether the wipe method is currently being executed
|
/// </summary>
|
private bool _isWiping = false;
|
|
/// <summary>
|
/// Locker object, used to lock set operations when a wipe is in progress
|
/// </summary>
|
private object _setLock = new object();
|
|
/// <summary>
|
/// State flag indicating whether any non-waitable set action is currently being executed
|
/// </summary>
|
private bool _isSetting = false;
|
|
|
|
}
|
|
}
|