Skip to content

Commit

Permalink
chore(deps): update dependency ziggycreatures.fusioncache to v1.2.0 (#…
Browse files Browse the repository at this point in the history
…833)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[ZiggyCreatures.FusionCache](https://github.com/ZiggyCreatures/FusionCache)
| `1.1.0` -> `1.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/ZiggyCreatures.FusionCache/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/ZiggyCreatures.FusionCache/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/ZiggyCreatures.FusionCache/1.1.0/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/ZiggyCreatures.FusionCache/1.1.0/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>ZiggyCreatures/FusionCache
(ZiggyCreatures.FusionCache)</summary>

###
[`v1.2.0`](https://github.com/ZiggyCreatures/FusionCache/releases/tag/v1.2.0)

#### 🔑 Added DI Keyed Services support
([docs](https://github.com/ZiggyCreatures/FusionCache/blob/main/docs/DependencyInjection.md#-keyed-services))

Since .NET 8 we now have native support for multiple services of the
same type, identified by different names, thanks to the addition of so
called [keyed
services](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-8.0#keyed-services).

The idea is basically that we can now register services not only by type
but also by specifying the name, like this:

```csharp
services.AddKeyedSingleton<MyService>("foo");
services.AddKeyedSingleton<MyService>("bar");
```

and later is possible to resolve it by both the type and a name.

Another way is to simply mark a constructor parameter or web action with
the `[FromKeyedServices]` attribute, like this:

```csharp
app.MapGet("/foo", ([FromKeyedServices("foo")] MyService myService) => myService.Whatever(123));
app.MapGet("/bar", ([FromKeyedServices("bar")] MyService myService) => myService.Whatever(123));
```

From now on, when registering a named cache, we can simply add
`AsKeyedServiceByCacheName()` like this:

```csharp
services.AddFusionCache("MyCache")
  .AsKeyedServiceByCacheName();
```

and later we'll be able to have the named cache both as usual:

```csharp
app.MapGet("/foo", (IFusionCacheProvider cacheProvider) => {
  var cache = cacheProvider.GetCache("MyCache");
  cache.Set("key", 123);
});
```

and as a keyed service, like this:

```csharp
app.MapGet("/foo", ([FromKeyedServices("MyCache")] IFusionCache cache) => {
  cache.Set("key", 123);
});
```

We can even use `AsKeyedService(object? serviceKey)` and specify a
custom service key like for any other keyed service in .NET.

On top of being able to *register* FusionCache as a keyed service, we
can even *consume* keyed services as FusionCache components, like memory
cache, distributed cache, serializer, backplane, etc.

For more read at the [official
docs](https://github.com/ZiggyCreatures/FusionCache/blob/main/docs/DependencyInjection.md#-keyed-services).

See [here](https://github.com/ZiggyCreatures/FusionCache/issues/238)
for the original issue.

#### ⚡ Add `PreferSyncSerialization` option

It has been observed that in some situations async serialization and
deserialization can be slower than the sync counterpart: this has
nothing to do with FusionCache itself, but how serialization works in
general.

So I added a new option called `PreferSyncSerialization` (default:
`false`, fully backward compatible), that can allow the sync version to
be preferred.

See [here](https://github.com/ZiggyCreatures/FusionCache/issues/245)
for the original issue.

#### 🔭 Better OpenTelemetry traces for backplane notifications

Community user [@&#8203;imperugo](https://github.com/imperugo) noticed
that when using the backplane with OpenTelemetry traces enabled, all the
spans for the notifications incoming via the backplane were put under
one single parent span, basically creating a single mega-span
"containing" all the others.


![image](https://github.com/ZiggyCreatures/FusionCache/assets/1010086/fc22ccca-0420-4186-89a8-117a40a95479)

Ideally, each span for each notification should be on their own, and now
this is the case.

Also while I was at it I noticed another couple of things that, if added
to the traces, could make the developer experience better.
In detail:

- include a tag with the source id (the InstanceId of the remote
FusionCache instance)
- change the status of the trace in case of errors, like invalid
notifications or similar
- add an event in case of, well, some event occurring during the
activity

So yeah, I took this opportunity to make the overall experience better.

Finally, since backplane notifications can create a lot of background
noise inside observability tools, I changed the default so that, even
when there's a backplane setup, traces for backplane notifications are
not enabled: to change this simply enable it at setup time.

See [here](https://github.com/ZiggyCreatures/FusionCache/issues/253)
for the original issue.

#### 🐵 Add `ChaosMemoryCache`

Among all the chaos-related components already available, one to work
with `IMemoryCache` was missing: not anymore.

#### ✅ Better tests

Some more tests have been added, including better cross-platform
snapshot tests.

#### 📕 Docs

Updated some docs with the latest new things.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 7am on Sunday,before 7am on
Wednesday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/digdir/dialogporten).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net>
  • Loading branch information
renovate[bot] and oskogstad authored Jun 12, 2024
1 parent f2d9136 commit 0c240be
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="ZiggyCreatures.FusionCache" Version="1.1.0" />
<PackageReference Include="ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis" Version="1.1.0" />
<PackageReference Include="ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack" Version="1.1.0" />
<PackageReference Include="ZiggyCreatures.FusionCache" Version="1.2.0" />
<PackageReference Include="ZiggyCreatures.FusionCache.Backplane.StackExchangeRedis" Version="1.2.0" />
<PackageReference Include="ZiggyCreatures.FusionCache.Serialization.NeueccMessagePack" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 0c240be

Please sign in to comment.