Hyperbee.Pipeline.Caching
3.0.0
dotnet add package Hyperbee.Pipeline.Caching --version 3.0.0
NuGet\Install-Package Hyperbee.Pipeline.Caching -Version 3.0.0
<PackageReference Include="Hyperbee.Pipeline.Caching" Version="3.0.0" />
<PackageVersion Include="Hyperbee.Pipeline.Caching" Version="3.0.0" />
<PackageReference Include="Hyperbee.Pipeline.Caching" />
paket add Hyperbee.Pipeline.Caching --version 3.0.0
#r "nuget: Hyperbee.Pipeline.Caching, 3.0.0"
#:package Hyperbee.Pipeline.Caching@3.0.0
#addin nuget:?package=Hyperbee.Pipeline.Caching&version=3.0.0
#tool nuget:?package=Hyperbee.Pipeline.Caching&version=3.0.0
Hyperbee.Pipeline.Caching
The Hyperbee.Pipeline.Caching library is a set of extentsions to Hyperbee.Pipeline that adds support for caching within a pipeline using Microsoft.Extensions.Caching libraries.
Memory Cache Examples
For simple pipelines the previous step's return value can be used as the key:
// Takes a string and returns a number
var command = PipelineFactory
.Start<string>()
.PipeCacheAsync( CharacterCountAsync )
.Build();
var result = await command( factory.Create( logger ), "test" );
Assert.AreEqual( 4, result );
Or for more complex the options callback can be used to customize how the results will be cached.
// Takes a string and returns a number
var command = PipelineFactory
.Start<string>()
.PipeCacheAsync( CharacterCountAsync,
( input, options ) =>
{
options.Key = $"custom/{input}";
options.AbsoluteExpirationRelativeToNow = TimeSpan.FromHours( 1 );
return options;
} )
.Build();
var result = await command( factory.Create( logger ), "test" );
Assert.AreEqual( 4, result );
When a set of steps should cache the overload that takes a builder can be used. In this case the inital input will be used at the key and the final step of the nested pipeline will be cached
// Takes a string and returns a number
var command = PipelineFactory
.Start<string>()
.PipeCacheAsync( b => b
.PipeAsync( CharacterCountAsync )
.Pipe( (ctx, arg) => arg + 100 ))
.Build();
var result = await command( factory.Create( logger ), "test" );
Assert.AreEqual( 104, result );
Distributed Cache
Distributed Caches work in the same way, but requires the registration of a IDistributedCache, an optional ICacheSerializer serializer (defaults to Json) and only supports Async methods
var command = PipelineFactory
.Start<string>()
.PipeDistributedCacheAsync( CharacterCountAsync )
.Build();
Dependency Injection
Because this uses the existing DI built into pipelines, caching can be configured with an existing cache.
Memory Cache
// Add Memory Cache
services.AddMemoryCache();
// Share with the pipelines
services.AddPipeline( includeAllServices: true );
Or defined seperately as part of the container use for the pipelines:
services.AddPipeline( (factoryServices, rootProvider) =>
{
factoryServices.AddMemoryCache();
factoryServices.AddPipelineDefaultCacheSettings( absoluteExpirationRelativeToNow: TimeSpan.FromHours( 1 ) )
} );
Distributed Cache
An Establish caching services such as SQL needs to be configured:
services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = builder.Configuration.GetConnectionString(
"DistCache_ConnectionString");
options.SchemaName = "dbo";
options.TableName = "TestCache";
});
An Optional ICacheSerializer can be registered. If one is missing the JsonCacheSerializer which uses System.Text.Json.JsonSerializer is used.
services.AddTransient<ICacheSerializer, JsonCacheSerializer>()
Target frameworks
net11.0, net10.0, netstandard2.1. A net8.0 or net9.0 project resolves the
netstandard2.1 asset; see the repository README.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. net11.0 is compatible. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Hyperbee.Pipeline (>= 3.0.0)
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.6)
-
net10.0
- Hyperbee.Pipeline (>= 3.0.0)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.2)
-
net11.0
- Hyperbee.Pipeline (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 49 | 11/28/2026 |
| 2.16.1 | 79 | 11/26/2026 |
| 2.16.0 | 79 | 11/26/2026 |
| 2.15.0 | 160 | 7/15/2026 |
| 2.14.0 | 156 | 6/8/2026 |
| 2.13.0 | 136 | 5/19/2026 |
| 2.12.0 | 152 | 4/12/2026 |
| 2.11.1 | 154 | 3/26/2026 |
| 2.10.1-alpha-gc6f6d9837f | 135 | 3/25/2026 |
| 2.9.1 | 142 | 3/19/2026 |
| 2.9.0 | 140 | 3/19/2026 |
| 2.8.2 | 159 | 3/16/2026 |
| 2.7.0 | 164 | 2/28/2026 |
| 2.6.0 | 151 | 2/28/2026 |
| 2.5.0 | 149 | 2/28/2026 |
| 2.4.0 | 145 | 2/27/2026 |
| 2.3.3 | 149 | 2/24/2026 |
| 2.3.2 | 153 | 2/18/2026 |
| 2.3.1 | 142 | 2/18/2026 |
| 2.3.0 | 158 | 2/17/2026 |