From 70514c3a759a3030c80b47e00a5f3beb8dab0cd9 Mon Sep 17 00:00:00 2001 From: Jody Donetti Date: Mon, 9 Dec 2024 23:14:18 +0100 Subject: [PATCH] v2.0.0-preview-3 --- .../ParallelComparisonBenchmark.cs | 2 +- ...eatures.FusionCache.Backplane.Memory.csproj | 2 +- ...onCache.Backplane.StackExchangeRedis.csproj | 4 ++-- .../ZiggyCreatures.FusionCache.Chaos.csproj | 2 +- ...yCreatures.FusionCache.OpenTelemetry.csproj | 2 +- ...ache.Serialization.CysharpMemoryPack.csproj | 2 +- ...ache.Serialization.NeueccMessagePack.csproj | 4 ++-- ...onCache.Serialization.NewtonsoftJson.csproj | 2 +- ...usionCache.Serialization.ProtoBufNet.csproj | 2 +- ...Cache.Serialization.ServiceStackJson.csproj | 5 +++-- ...onCache.Serialization.SystemTextJson.csproj | 3 ++- src/ZiggyCreatures.FusionCache/FusionCache.cs | 4 ++-- .../FusionCacheDiagnostics.cs | 2 +- .../FusionCacheOptions.cs | 4 ++-- .../FusionCache_Async.cs | 2 +- .../FusionCache_Sync.cs | 2 +- .../ZiggyCreatures.FusionCache.csproj | 18 ++++++++++++++---- ...iggyCreatures.FusionCache.Playground.csproj | 5 ++--- ...ZiggyCreatures.FusionCache.Simulator.csproj | 4 ++-- .../MemoryLevelTests.cs | 4 ++-- .../ZiggyCreatures.FusionCache.Tests.csproj | 2 +- 21 files changed, 44 insertions(+), 33 deletions(-) diff --git a/benchmarks/ZiggyCreatures.FusionCache.Benchmarks/ParallelComparisonBenchmark.cs b/benchmarks/ZiggyCreatures.FusionCache.Benchmarks/ParallelComparisonBenchmark.cs index bacd3b12..2f099e25 100644 --- a/benchmarks/ZiggyCreatures.FusionCache.Benchmarks/ParallelComparisonBenchmark.cs +++ b/benchmarks/ZiggyCreatures.FusionCache.Benchmarks/ParallelComparisonBenchmark.cs @@ -80,7 +80,7 @@ public void Setup() // SETUP CACHES _FusionCache = new FusionCache(new FusionCacheOptions { DefaultEntryOptions = new FusionCacheEntryOptions(CacheDuration) }); - _FusionCacheNoTagging = new FusionCache(new FusionCacheOptions { DefaultEntryOptions = new FusionCacheEntryOptions(CacheDuration), DisabledTagging = true }); + _FusionCacheNoTagging = new FusionCache(new FusionCacheOptions { DefaultEntryOptions = new FusionCacheEntryOptions(CacheDuration), DisableTagging = true }); _FusionCacheProbabilistic = new FusionCache(new FusionCacheOptions { DefaultEntryOptions = new FusionCacheEntryOptions(CacheDuration) }, memoryLocker: new ProbabilisticMemoryLocker()); _CacheTower = new CacheStack(null, new CacheStackOptions([new MemoryCacheLayer()]) { Extensions = [new AutoCleanupExtension(TimeSpan.FromMinutes(5))] }); _EasyCaching = ServiceProvider.GetRequiredService().GetCachingProvider("default"); diff --git a/src/ZiggyCreatures.FusionCache.Backplane.Memory/ZiggyCreatures.FusionCache.Backplane.Memory.csproj b/src/ZiggyCreatures.FusionCache.Backplane.Memory/ZiggyCreatures.FusionCache.Backplane.Memory.csproj index a8578d97..b4f4dbcc 100644 --- a/src/ZiggyCreatures.FusionCache.Backplane.Memory/ZiggyCreatures.FusionCache.Backplane.Memory.csproj +++ b/src/ZiggyCreatures.FusionCache.Backplane.Memory/ZiggyCreatures.FusionCache.Backplane.Memory.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Backplane.Memory FusionCache in memory backplane, used for testing backplane;memory;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy diff --git a/src/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis.csproj b/src/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis.csproj index 99f31a15..3a59ebfc 100644 --- a/src/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis.csproj +++ b/src/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis/ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis FusionCache backplane for Redis based on the StackExchange.Redis library backplane;redis;stackexchange;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy @@ -24,7 +24,7 @@ - + diff --git a/src/ZiggyCreatures.FusionCache.Chaos/ZiggyCreatures.FusionCache.Chaos.csproj b/src/ZiggyCreatures.FusionCache.Chaos/ZiggyCreatures.FusionCache.Chaos.csproj index bf248db4..69870b2d 100644 --- a/src/ZiggyCreatures.FusionCache.Chaos/ZiggyCreatures.FusionCache.Chaos.csproj +++ b/src/ZiggyCreatures.FusionCache.Chaos/ZiggyCreatures.FusionCache.Chaos.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Chaos Chaos-related utilities and implementations of various componenets (like a distributed cache or a backplane), useful for things like testing dependent components' behavior in a controlled failing environment. chaos;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy diff --git a/src/ZiggyCreatures.FusionCache.OpenTelemetry/ZiggyCreatures.FusionCache.OpenTelemetry.csproj b/src/ZiggyCreatures.FusionCache.OpenTelemetry/ZiggyCreatures.FusionCache.OpenTelemetry.csproj index 07d05cf7..40308335 100644 --- a/src/ZiggyCreatures.FusionCache.OpenTelemetry/ZiggyCreatures.FusionCache.OpenTelemetry.csproj +++ b/src/ZiggyCreatures.FusionCache.OpenTelemetry/ZiggyCreatures.FusionCache.OpenTelemetry.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.OpenTelemetry Add native OpenTelemetry support to FusionCache. telemetry;observability;opentelemetry;open-telemetry;chaos;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy diff --git a/src/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack.csproj b/src/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack.csproj index e9e2f24d..d40599ab 100644 --- a/src/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack.csproj +++ b/src/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack/ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack.csproj @@ -2,7 +2,7 @@ netstandard2.1;net7.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack FusionCache serializer based on Cysharp's MemoryPack serializer memorypack;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede diff --git a/src/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack.csproj b/src/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack.csproj index faf6e4e9..6c36c9f7 100644 --- a/src/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack.csproj +++ b/src/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack/ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack FusionCache serializer based on Neuecc's MessagePack serializer messagepack;msgpack;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede @@ -25,7 +25,7 @@ - + diff --git a/src/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson.csproj b/src/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson.csproj index ba6d2063..ebf70ad1 100644 --- a/src/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson.csproj +++ b/src/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson/ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson FusionCache serializer based on Newtonsoft Json.NET json;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede diff --git a/src/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet.csproj b/src/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet.csproj index 61611716..6bbcc8b3 100644 --- a/src/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet.csproj +++ b/src/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet/ZiggyCreatures.FusionCache.Serialization.ProtoBufNet.csproj @@ -2,7 +2,7 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Serialization.ProtoBufNet FusionCache serializer based on protobuf-net protobuf;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy diff --git a/src/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson.csproj b/src/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson.csproj index 7e2dbf42..3283598e 100644 --- a/src/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson.csproj +++ b/src/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson/ZiggyCreatures.FusionCache.Serialization.ServiceStackJson.csproj @@ -2,13 +2,14 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Serialization.ServiceStackJson FusionCache serializer based on ServiceStack's Json serializer json;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede ZiggyCreatures.Caching.Fusion.Serialization.ServiceStackJson true + - Add: Tagging support (preview) - Update: package dependencies 1.0.0 @@ -24,7 +25,7 @@ - + diff --git a/src/ZiggyCreatures.FusionCache.Serialization.SystemTextJson/ZiggyCreatures.FusionCache.Serialization.SystemTextJson.csproj b/src/ZiggyCreatures.FusionCache.Serialization.SystemTextJson/ZiggyCreatures.FusionCache.Serialization.SystemTextJson.csproj index 51643901..af095fd1 100644 --- a/src/ZiggyCreatures.FusionCache.Serialization.SystemTextJson/ZiggyCreatures.FusionCache.Serialization.SystemTextJson.csproj +++ b/src/ZiggyCreatures.FusionCache.Serialization.SystemTextJson/ZiggyCreatures.FusionCache.Serialization.SystemTextJson.csproj @@ -2,13 +2,14 @@ netstandard2.0 - 2.0.0-preview-1 + 2.0.0-preview-3 ZiggyCreatures.FusionCache.Serialization.SystemTextJson FusionCache serializer based on System.Text.Json json;caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy ZiggyCreatures.Caching.Fusion.Serialization.SystemTextJson true + - Add: Tagging support (preview) - Update: package dependencies 1.0.0 diff --git a/src/ZiggyCreatures.FusionCache/FusionCache.cs b/src/ZiggyCreatures.FusionCache/FusionCache.cs index 9b69cc82..51bb0e35 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCache.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCache.cs @@ -657,8 +657,8 @@ internal void ExpireMemoryEntryInternal(string operationId, string key, long? ti [MethodImpl(MethodImplOptions.AggressiveInlining)] private void CheckTaggingEnabled() { - if (_options.DisabledTagging) - throw new InvalidOperationException("This operation requires Tagging, which has been disabled via FusionCacheOptions.DisabledTagging."); + if (_options.DisableTagging) + throw new InvalidOperationException("This operation requires Tagging, which has been disabled via FusionCacheOptions.DisableTagging."); } private static string GetTagCacheKey(string tag) diff --git a/src/ZiggyCreatures.FusionCache/FusionCacheDiagnostics.cs b/src/ZiggyCreatures.FusionCache/FusionCacheDiagnostics.cs index f6f112f8..d4ebb6be 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCacheDiagnostics.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCacheDiagnostics.cs @@ -8,7 +8,7 @@ public static class FusionCacheDiagnostics /// /// The current version of FusionCache. /// - public const string FusionCacheVersion = "2.0.0-preview-2"; + public const string FusionCacheVersion = "2.0.0-preview-3"; /// /// The activity source name for FusionCache. diff --git a/src/ZiggyCreatures.FusionCache/FusionCacheOptions.cs b/src/ZiggyCreatures.FusionCache/FusionCacheOptions.cs index 0ff780e3..6d4a2730 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCacheOptions.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCacheOptions.cs @@ -395,7 +395,7 @@ public TimeSpan BackplaneAutoRecoveryDelay ///
/// NOTE: this may get to a little performance improvement, but if you'll try to call one of the above methods an will be thrown. ///
- public bool DisabledTagging { get; set; } + public bool DisableTagging { get; set; } /// /// Specify the to use when some options have incoherent values that have been fixed with a normalization, like for example when a FailSafeMaxDuration is lower than a Duration, so the Duration is used instead. @@ -533,7 +533,7 @@ public FusionCacheOptions Duplicate() IncludeTagsInTraces = IncludeTagsInTraces, IncludeTagsInMetrics = IncludeTagsInMetrics, - DisabledTagging = DisabledTagging, + DisableTagging = DisableTagging, SkipAutoCloneForImmutableObjects = SkipAutoCloneForImmutableObjects, diff --git a/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs b/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs index bec21885..a3db27c8 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCache_Async.cs @@ -785,7 +785,7 @@ public async ValueTask ExpireAsync(string key, FusionCacheEntryOptions? options if (entry is null) return (null, false); - if (_options.DisabledTagging) + if (_options.DisableTagging) return (entry, true); var entryTimestamp = entry.Timestamp; diff --git a/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs b/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs index 42adac7e..12bd85d9 100644 --- a/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs +++ b/src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs @@ -785,7 +785,7 @@ public void Expire(string key, FusionCacheEntryOptions? options = null, Cancella if (entry is null) return (null, false); - if (_options.DisabledTagging) + if (_options.DisableTagging) return (entry, true); var entryTimestamp = entry.Timestamp; diff --git a/src/ZiggyCreatures.FusionCache/ZiggyCreatures.FusionCache.csproj b/src/ZiggyCreatures.FusionCache/ZiggyCreatures.FusionCache.csproj index b7450684..e0769445 100644 --- a/src/ZiggyCreatures.FusionCache/ZiggyCreatures.FusionCache.csproj +++ b/src/ZiggyCreatures.FusionCache/ZiggyCreatures.FusionCache.csproj @@ -2,16 +2,26 @@ netstandard2.0;netcoreapp3.1;net6.0;net7.0;net8.0 - 2.0.0-preview-2 + 2.0.0-preview-3 ZiggyCreatures.FusionCache FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features. caching;cache;hybrid;hybrid-cache;hybridcache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy ZiggyCreatures.Caching.Fusion True - - Add: Tagging support (preview) - - Add: Clear() support (preview) + - Add: Tagging support + - Add: Clear support + - Add: native support for Microsoft's new HybridCache (via the new ZiggyCreatures.FusionCache.MicrosoftHybridCache package) + - Fix: soft-fails in a factory (eg: ctx.Fail("Oops")) is now supported for with background factory completion + - Change: better Expire, more predictable + - Change: ReThrowSerializationExceptions does not affect serialization, only deserialization + - Add: support for immutable objects when using Auto-Clone + - Add: support for Tagging/Clear in events - Add: new IncludeTagsInLogs option + - Add: new IncludeTagsInTraces option + - Add: new IncludeTagsInMetrics option + - Change: the auto-generated InstanceId for each cache is now shorter (saves space in logs and traces) + - Update: all [Obsolete] members has been marked as errors - Update: package dependencies