Sparkdo.MassHub.Utilities
1.0.3
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Sparkdo.MassHub.Utilities --version 1.0.3
NuGet\Install-Package Sparkdo.MassHub.Utilities -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sparkdo.MassHub.Utilities" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.MassHub.Utilities" Version="1.0.3" />
<PackageReference Include="Sparkdo.MassHub.Utilities" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sparkdo.MassHub.Utilities --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sparkdo.MassHub.Utilities, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sparkdo.MassHub.Utilities@1.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sparkdo.MassHub.Utilities&version=1.0.3
#tool nuget:?package=Sparkdo.MassHub.Utilities&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.MassHub.Utilities
消息总线的通用工具集,提供高性能内存池化缓冲区、可写入内存抽象和可池化特性集合,减少消息处理管道中的堆分配。
功能特性
- IWritableMemory:可写入内存抽象,支持自定义缓冲区和池化分配器
- PooledArrayWriter:基于
ArrayPool<T>的池化缓冲区写入器,序列化场景下零额外分配 - PooledFeatureCollection:可回收到对象池的特性集合,降低中间件管道的 GC 压力
- ReadOnlyMemorySegment:只读内存段的链表分割表示,支持 Zero-Copy 数据切分
- BufferPools:统一的缓冲池管理,包括
ArrayPool与MemoryPool的共享实例
安装
dotnet add package Sparkdo.MassHub.Utilities
使用示例
// 池化数组写入器
using var writer = new PooledArrayWriter<byte>();
writer.Write("Hello"u8);
// writer.WrittenMemory 获取已写入的数据,无需额外分配
// 池化特性集合
var features = PooledFeatureCollection.Rent();
features.Set<ICustomFeature>(new CustomFeature());
// ...
features.Return(); // 归还到对象池
// 只读内存段
var segment = new ReadOnlyMemorySegment<byte>(buffer);
var next = segment.Append(nextBuffer); // 零拷贝链表追加
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Sparkdo.MassHub.Abstractions (>= 1.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Sparkdo.MassHub.Utilities:
| Package | Downloads |
|---|---|
|
Sparkdo.MassHub
Sparkdo 消息总线核心库,提供消息分发、中间件管道、路由、序列化等核心功能 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.4-preview.3 | 77 | 6/8/2026 |
| 1.0.4-preview.2 | 92 | 6/7/2026 |
| 1.0.4-preview.1 | 90 | 6/7/2026 |
| 1.0.3 | 190 | 6/6/2026 |