Bsft.Caching.EventAggregator
2.2.0
dotnet add package Bsft.Caching.EventAggregator --version 2.2.0
NuGet\Install-Package Bsft.Caching.EventAggregator -Version 2.2.0
<PackageReference Include="Bsft.Caching.EventAggregator" Version="2.2.0" />
<PackageVersion Include="Bsft.Caching.EventAggregator" Version="2.2.0" />
<PackageReference Include="Bsft.Caching.EventAggregator" />
paket add Bsft.Caching.EventAggregator --version 2.2.0
#r "nuget: Bsft.Caching.EventAggregator, 2.2.0"
#:package Bsft.Caching.EventAggregator@2.2.0
#addin nuget:?package=Bsft.Caching.EventAggregator&version=2.2.0
#tool nuget:?package=Bsft.Caching.EventAggregator&version=2.2.0
Bsft.Caching.EventAggregator
The adapter between the Bsft.Caching and Bsft.EventAggregator families: a hosted subscriber that
evicts cached query results when an invalidation event is published in-process, so a write handler can
invalidate without taking a reference on the cache.
Install
dotnet add package Bsft.Caching.EventAggregator
Requires Bsft.Caching and Bsft.EventAggregator, both of which must already be registered — this
package supplies no cache and no aggregator of its own.
Register
services.AddBsftCaching();
services.AddBsftEventAggregator();
services.AddBsftCacheInvalidation();
Nothing else is required. Publish CacheKeyInvalidatedEvent or CacheTagInvalidatedEvent through
IEventAggregator and the subscriber calls ICacheInvalidator for you. The subscriber is an
IHostedService, so it only runs where a host runs it.
Configure
| Option | Default | Effect |
|---|---|---|
| — | — | The package has no options type: what it registers is a single subscriber with nothing to tune. What gets evicted is decided by the event, and how far the eviction reaches is decided by BsftCachingOptions and by which ICacheTagIndex is registered. |
Validation: none — there is nothing to configure.
Extend
None. The two events are the surface: publish one and the eviction happens. Replace ICacheInvalidator
in Bsft.Caching to change what an eviction does, and ICacheTagIndex to change how far a tag
invalidation reaches — an in-process index bounds it to this instance, which is the trap worth knowing
about before wiring this up on a distributed cache.
Documentation
Topic page: docs/caching.md. Conventions: docs/package-conventions.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Bsft.Caching (>= 2.2.0)
- Bsft.EventAggregator (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
-
net8.0
- Bsft.Caching (>= 2.2.0)
- Bsft.EventAggregator (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.19)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.19)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.