Skip to content

Commit

Permalink
Merge branch 'main' into chore/#230_AddTFMToOptimisedDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jodydonetti authored Apr 20, 2024
2 parents 48b69f5 + a573ffe commit 1958b5a
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 84 deletions.
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
-->
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<PackageIcon>logo-128x128.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ And if you really want to talk about money, please consider making **❤ a dona

Yes!

FusionCache is being used **in production** on **real world projects** for years, happily handling millions of requests per day, or at least that is what I know directly: considering that the FusionCache packages have been downloaded more than **3 million times** (thanks everybody!) it may very well be used even more.
FusionCache is being used **in production** on **real world projects** for years, happily handling millions of requests.

Considering that the FusionCache packages have been downloaded more than **4 million times** (thanks everybody!) it may very well be used even more.

And again, if you are using it please [**✉ drop me a line**](https://twitter.com/jodydonetti), I'd like to know!
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<!--<TargetFrameworks>net6.0;net8.0</TargetFrameworks>-->
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<RootNamespace>ZiggyCreatures.Caching.Fusion.Benchmarks</RootNamespace>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Backplane.Memory</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache backplane for Redis based on the StackExchange.Redis library</Description>
<PackageTags>backplane;redis;stackexchange;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy</PackageTags>
<RootNamespace>ZiggyCreatures.Caching.Fusion.Backplane.StackExchangeRedis</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Chaos</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>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.</Description>
<PackageTags>chaos;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy</PackageTags>
<RootNamespace>ZiggyCreatures.Caching.Fusion.Chaos</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Chaos.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.OpenTelemetry</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>Add native OpenTelemetry support to FusionCache.</Description>
<PackageTags>telemetry;observability;opentelemetry;open-telemetry;chaos;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy</PackageTags>
<RootNamespace>ZiggyCreatures.FusionCache.OpenTelemetry</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.OpenTelemetry.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TargetFrameworks>netstandard2.1;net7.0</TargetFrameworks>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.CysharpMemoryPack</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache serializer based on Cysharp's MemoryPack serializer</Description>
<PackageTags>memorypack;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede</PackageTags>
<RootNamespace>ZiggyCreatures.Caching.Fusion.Serialization.CysharpMemoryPack</RootNamespace>
<DocumentationFile>ZiggyCreatures.Caching.Fusion.Serialization.CysharpMemoryPack.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache serializer based on Neuecc's MessagePack serializer</Description>
<PackageTags>messagepack;msgpack;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede</PackageTags>
<RootNamespace>ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache serializer based on Newtonsoft Json.NET</Description>
<PackageTags>json;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede</PackageTags>
<RootNamespace>ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Serialization.NewtonsoftJson.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.ProtoBufNet</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache serializer based on protobuf-net</Description>
<PackageTags>protobuf;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy</PackageTags>
<RootNamespace>ZiggyCreatures.FusionCache.Serialization.ProtoBufNet</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Serialization.ProtoBufNet.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.ServiceStackJson</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache serializer based on ServiceStack's Json serializer</Description>
<PackageTags>json;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy;cache-stampede</PackageTags>
<RootNamespace>ZiggyCreatures.FusionCache.Serialization.ServiceStackJson</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Serialization.ServiceStackJson.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache.Serialization.SystemTextJson</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache serializer based on System.Text.Json</Description>
<PackageTags>json;caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy</PackageTags>
<RootNamespace>ZiggyCreatures.FusionCache.Serialization.SystemTextJson</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.Serialization.SystemTextJson.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Updated: package dependencies
</PackageReleaseNotes>
Expand Down
15 changes: 5 additions & 10 deletions src/ZiggyCreatures.FusionCache/FusionCache_Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public partial class FusionCache
{
private async ValueTask<IFusionCacheMemoryEntry?> GetOrSetEntryInternalAsync<TValue>(string operationId, string key, Func<FusionCacheFactoryExecutionContext<TValue>, CancellationToken, Task<TValue>> factory, bool isRealFactory, MaybeValue<TValue> failSafeDefaultValue, FusionCacheEntryOptions? options, CancellationToken token)
{
if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

IFusionCacheMemoryEntry? memoryEntry = null;
bool memoryEntryIsValid = false;
Expand Down Expand Up @@ -394,8 +393,7 @@ public async ValueTask<TValue> GetOrSetAsync<TValue>(string key, TValue defaultV

private async ValueTask<IFusionCacheEntry?> TryGetEntryInternalAsync<TValue>(string operationId, string key, FusionCacheEntryOptions? options, CancellationToken token)
{
if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

token.ThrowIfCancellationRequested();

Expand Down Expand Up @@ -586,8 +584,7 @@ public async ValueTask SetAsync<TValue>(string key, TValue value, FusionCacheEnt

token.ThrowIfCancellationRequested();

if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

var operationId = MaybeGenerateOperationId();

Expand Down Expand Up @@ -624,8 +621,7 @@ public async ValueTask RemoveAsync(string key, FusionCacheEntryOptions? options

token.ThrowIfCancellationRequested();

if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

var operationId = MaybeGenerateOperationId();

Expand Down Expand Up @@ -659,8 +655,7 @@ public async ValueTask ExpireAsync(string key, FusionCacheEntryOptions? options

token.ThrowIfCancellationRequested();

if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

var operationId = MaybeGenerateOperationId();

Expand Down
15 changes: 5 additions & 10 deletions src/ZiggyCreatures.FusionCache/FusionCache_Sync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public partial class FusionCache
{
private IFusionCacheMemoryEntry? GetOrSetEntryInternal<TValue>(string operationId, string key, Func<FusionCacheFactoryExecutionContext<TValue>, CancellationToken, TValue> factory, bool isRealFactory, MaybeValue<TValue> failSafeDefaultValue, FusionCacheEntryOptions? options, CancellationToken token)
{
if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

IFusionCacheMemoryEntry? memoryEntry = null;
bool memoryEntryIsValid = false;
Expand Down Expand Up @@ -394,8 +393,7 @@ public TValue GetOrSet<TValue>(string key, TValue defaultValue, FusionCacheEntry

private IFusionCacheEntry? TryGetEntryInternal<TValue>(string operationId, string key, FusionCacheEntryOptions? options, CancellationToken token)
{
if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

token.ThrowIfCancellationRequested();

Expand Down Expand Up @@ -586,8 +584,7 @@ public void Set<TValue>(string key, TValue value, FusionCacheEntryOptions? optio

token.ThrowIfCancellationRequested();

if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

var operationId = MaybeGenerateOperationId();

Expand Down Expand Up @@ -624,8 +621,7 @@ public void Remove(string key, FusionCacheEntryOptions? options = null, Cancella

token.ThrowIfCancellationRequested();

if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

var operationId = MaybeGenerateOperationId();

Expand Down Expand Up @@ -659,8 +655,7 @@ public void Expire(string key, FusionCacheEntryOptions? options = null, Cancella

token.ThrowIfCancellationRequested();

if (options is null)
options = _options.DefaultEntryOptions;
options ??= _options.DefaultEntryOptions;

var operationId = MaybeGenerateOperationId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ public IFusionCache Build(IServiceProvider serviceProvider)
if (options is null)
{
options = Options;
}

if (options is null)
{
options = new FusionCacheOptions()
if (options is null)
{
CacheName = CacheName
};
options = new FusionCacheOptions()
{
CacheName = CacheName
};
}
}

SetupOptionsAction?.Invoke(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>1.0.0</Version>
<PackageId>ZiggyCreatures.FusionCache</PackageId>
<PackageIcon>logo-128x128.png</PackageIcon>
<Description>FusionCache is an easy to use, fast and robust cache with advanced resiliency features and an optional distributed 2nd level.</Description>
<PackageTags>caching;cache;multi-level;multilevel;fusion;fusioncache;fusion-cache;performance;async;ziggy</PackageTags>
<RootNamespace>ZiggyCreatures.Caching.Fusion</RootNamespace>
<DocumentationFile>ZiggyCreatures.FusionCache.xml</DocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>
- Perf: zero allocations/minimal cpu usage in Get happy path
- Perf: greatly reduced allocations/cpu usage in Set happy path
Expand Down
4 changes: 2 additions & 2 deletions src/ZiggyCreatures.FusionCache/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ FusionCache targets `.NET Standard 2.0` so any compatible .NET implementation is

Yes!

FusionCache is being used **in production** on **real world projects** for years, happily handling millions of requests per day.
FusionCache is being used **in production** on **real world projects** for years, happily handling millions of requests.

Considering that the FusionCache packages have been downloaded more than **3 million times** (thanks everybody!) it may very well be used even more.
Considering that the FusionCache packages have been downloaded more than **4 million times** (thanks everybody!) it may very well be used even more.

And again, if you are using it please [**✉ drop me a line**](https://twitter.com/jodydonetti), I'd like to know!
2 changes: 1 addition & 1 deletion tests/SerializerPayloadGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void TestSamples<T>(IFusionCacheSerializer[] serializers)
Console.WriteLine("SAMPLES:");
foreach (var file in files)
{
var payloadVersion = Regex.Match(file, @"\w+__v(\d+_\d+_\d+)_\d+\.bin").Groups[1]?.Value?.Replace('_', '.');
var payloadVersion = Regex.Match(file, @"\w+__v(\d+_\d+_\d+)_\d+\.bin").Groups[1].Value.Replace('_', '.');

var payload = File.ReadAllBytes(file);
Console.Write($"- FROM v{payloadVersion}: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected override void OnEventSourceCreated(EventSource eventSource)

protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
_logger.LogWarning("WARN: Message = {Message}, Payload = {Payload}", eventData.Message, eventData.Payload?.Select(p => p?.ToString())?.ToArray()!);
_logger.LogWarning("WARN: Message = {Message}, Payload = {Payload}", eventData.Message, eventData.Payload?.Select(p => p?.ToString()).ToArray()!);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<RootNamespace>ZiggyCreatures.Caching.Fusion.Playground</RootNamespace>
<UserSecretsId>1f4e47b6-6dd9-49b0-af63-058750249662</UserSecretsId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<RootNamespace>ZiggyCreatures.Caching.Fusion.Simulator</RootNamespace>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/ZiggyCreatures.FusionCache.Tests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public async Task CanDeserializeOldVersionsAsync(SerializerType serializerType)

foreach (var file in files)
{
var payloadVersion = __re_VersionExtractor.Match(file).Groups[1]?.Value?.Replace('_', '.');
var payloadVersion = __re_VersionExtractor.Match(file).Groups[1].Value.Replace('_', '.');

var payload = File.ReadAllBytes(file);
var deserialized = await serializer.DeserializeAsync<FusionCacheDistributedEntry<string>>(payload);
Expand Down Expand Up @@ -267,7 +267,7 @@ public void CanDeserializeOldVersions(SerializerType serializerType)

foreach (var file in files)
{
var payloadVersion = __re_VersionExtractor.Match(file).Groups[1]?.Value?.Replace('_', '.');
var payloadVersion = __re_VersionExtractor.Match(file).Groups[1].Value.Replace('_', '.');

var payload = File.ReadAllBytes(file);
var deserialized = serializer.Deserialize<FusionCacheDistributedEntry<string>>(payload);
Expand Down
Loading

0 comments on commit 1958b5a

Please sign in to comment.