Sparkdo.MassHub.Abstractions
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.Abstractions --version 1.0.3
NuGet\Install-Package Sparkdo.MassHub.Abstractions -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.Abstractions" 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.Abstractions" Version="1.0.3" />
<PackageReference Include="Sparkdo.MassHub.Abstractions" />
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.Abstractions --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sparkdo.MassHub.Abstractions, 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.Abstractions@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.Abstractions&version=1.0.3
#tool nuget:?package=Sparkdo.MassHub.Abstractions&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sparkdo.MassHub.Abstractions
Sparkdo.MassHub 的核心抽象层,定义消息处理程序、事件类型的契约接口和程序集级模块元数据,为消息总线基础设施提供编译时类型解析支持。
功能特性
- IHandler 基接口:通过静态抽象成员暴露 RequestType / ResponseType / EventType 元数据,无需运行时反射
- IEventHandler:通知型事件处理程序,不期望响应
- IEventRequestHandler:请求-响应型处理程序,支持有/无响应两种模式
- IEventRequest:请求事件标记接口
- IFeatureCollection / IFeatureProvider:中间件管道特性传递机制
- MessagingModuleAttribute:程序集级模块声明,配合源生成器自动注册处理程序
安装
dotnet add package Sparkdo.MassHub.Abstractions
使用示例
// 通知事件 —— 无需响应
public sealed class OrderShippedHandler : IEventHandler<OrderShippedEvent>
{
public ValueTask HandleAsync(OrderShippedEvent message, CancellationToken ct)
{
// 处理通知
return default;
}
}
// 请求-响应 —— 期望返回值
public sealed class GetOrderHandler : IEventRequestHandler<GetOrderRequest, OrderDto>
{
public async ValueTask<OrderDto> HandleAsync(GetOrderRequest request, CancellationToken ct)
{
// 处理请求并返回响应
return new OrderDto();
}
}
| 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
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Sparkdo.MassHub.Abstractions:
| Package | Downloads |
|---|---|
|
Sparkdo.MassHub.Utilities
Sparkdo 消息总线实用工具(缓冲池、对象池、特性集合) |
|
|
Sparkdo.MassHub
Sparkdo 消息总线核心库,提供消息分发、中间件管道、路由、序列化等核心功能 |
|
|
Sparkdo.MassHub.EntityFrameworkCore
Sparkdo 消息总线 EF Core 集成(事务中间件、Saga 持久化、Outbox 存储) |
|
|
Sparkdo.MassHub.Transport.InMemory
Sparkdo 消息总线内存传输实现,适用于测试和单进程场景 |
|
|
Sparkdo.MassHub.Transport.RabbitMQ
Sparkdo 消息总线 RabbitMQ 传输实现,适用于高吞吐微服务场景 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.4-preview.3 | 71 | 6/8/2026 |
| 1.0.4-preview.2 | 74 | 6/7/2026 |
| 1.0.4-preview.1 | 82 | 6/7/2026 |
| 1.0.3 | 167 | 6/6/2026 |