|
@@ -1,4 +1,4 @@ |
|
|
using System; |
|
|
|
|
|
|
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Threading; |
|
|
using System.Threading; |
|
@@ -15,7 +15,7 @@ namespace DotNetCore.CAP.Dashboard |
|
|
/// </summary> |
|
|
/// </summary> |
|
|
// ReSharper disable once InheritdocConsiderUsage |
|
|
// ReSharper disable once InheritdocConsiderUsage |
|
|
// ReSharper disable once InconsistentNaming |
|
|
// ReSharper disable once InconsistentNaming |
|
|
internal class Cache<K, T> : IDisposable |
|
|
|
|
|
|
|
|
public class Cache<K, T> : IDisposable |
|
|
{ |
|
|
{ |
|
|
#region Constructor and class members |
|
|
#region Constructor and class members |
|
|
|
|
|
|
|
@@ -121,7 +121,7 @@ namespace DotNetCore.CAP.Dashboard |
|
|
|
|
|
|
|
|
private void RemoveByTimer(object state) |
|
|
private void RemoveByTimer(object state) |
|
|
{ |
|
|
{ |
|
|
Remove((K) state); |
|
|
|
|
|
|
|
|
Remove((K)state); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endregion |
|
|
#endregion |
|
@@ -251,8 +251,8 @@ namespace DotNetCore.CAP.Dashboard |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var removers = (from k in _cache.Keys.Cast<K>() |
|
|
var removers = (from k in _cache.Keys.Cast<K>() |
|
|
where keyPattern(k) |
|
|
|
|
|
select k).ToList(); |
|
|
|
|
|
|
|
|
where keyPattern(k) |
|
|
|
|
|
select k).ToList(); |
|
|
|
|
|
|
|
|
foreach (var workKey in removers) |
|
|
foreach (var workKey in removers) |
|
|
{ |
|
|
{ |
|
@@ -354,7 +354,7 @@ namespace DotNetCore.CAP.Dashboard |
|
|
/// instance. |
|
|
/// instance. |
|
|
/// The <c>.Global</c> member is lazy instanciated. |
|
|
/// The <c>.Global</c> member is lazy instanciated. |
|
|
/// </summary> |
|
|
/// </summary> |
|
|
internal class CapCache : Cache<string, object> |
|
|
|
|
|
|
|
|
public class CapCache : Cache<string, object> |
|
|
{ |
|
|
{ |
|
|
#region Static Global Cache instance |
|
|
#region Static Global Cache instance |
|
|
|
|
|
|
|
@@ -372,4 +372,4 @@ namespace DotNetCore.CAP.Dashboard |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endregion |
|
|
#endregion |
|
|
} |
|
|
|
|
|
|
|
|
} |