tangxu
2024-04-30 26d8996e55c33186800031f7c305688035bb3182
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using System.Collections.Concurrent;
 
namespace IStation.ChEr
{
    /// <summary>
    /// 
    /// </summary>
    internal sealed partial class SharedMemoryCache
    {
        /// <summary>
        /// 私有构造函数
        /// </summary>
        private SharedMemoryCache()
        {
            _memoryCache = new Microsoft.Extensions.Caching.Memory.MemoryCache(Options.Create(new MemoryCacheOptions()));
            _cacheKeysBeingHandled = new ConcurrentDictionary<string, CacheKeyBeingHandled>();
        }
 
        /// <summary>
        /// 获取缓存实例
        /// </summary>
        public static SharedMemoryCache Instance => _lazy.Value;
 
    }
}