using System.Linq; using System.Threading.Tasks; namespace IStation { internal sealed partial class SharedMemoryCache { /// /// Flush will remove all cache entries, but not block any set operations /// public void Flush() { if (this._isWiping) { return; } var keys = GetKeys(); Parallel.ForEach(keys, x => ((IMemoryCacheDirect)this).Remove(x)); } } }