Sparkdo.EventBus 2.0.0-preview.2

This is a prerelease version of Sparkdo.EventBus.
dotnet add package Sparkdo.EventBus --version 2.0.0-preview.2
                    
NuGet\Install-Package Sparkdo.EventBus -Version 2.0.0-preview.2
                    
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.EventBus" Version="2.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.EventBus" Version="2.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.EventBus" />
                    
Project file
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.EventBus --version 2.0.0-preview.2
                    
#r "nuget: Sparkdo.EventBus, 2.0.0-preview.2"
                    
#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.EventBus@2.0.0-preview.2
                    
#: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.EventBus&version=2.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.EventBus&version=2.0.0-preview.2&prerelease
                    
Install as a Cake Tool

Sparkdo.EventBus

Sparkdo.EventBus 是独立的进程内事件产品域。它提供精确事件类型路由、提交生命周期阶段、可取消异步处理、顺序或并发执行,以及基于 DI 的处理器生命周期管理。

当前版本只处理同一进程内的事件,不提供分布式传输、Outbox、Inbox、后台可靠投递或跨进程确认。领域层只依赖 Sparkdo.EventBus.Abstractions;需要运行时接线时引用 Sparkdo.EventBus

最小接入

services.UseEventBus(eventBus =>
{
    eventBus.AddHandler<OrderCreatedHandler, OrderCreated>();
    eventBus.AddHandler<IndexOrderHandler, OrderCreated>(EventPhase.AfterCommit);
});

默认按注册顺序顺序执行。需要并发时显式配置:

services.UseEventBus(eventBus =>
{
    eventBus.Configure(options => options.PublishMode = EventPublishMode.Concurrent);
});

发布器在应用作用域内解析,处理器默认按 scoped 生命周期创建。没有匹配处理器的事件视为成功;处理器异常和取消异常原样传播,不包装为 EventBus 异常。

产品域文档

验证

dotnet test src/event-bus/Sparkdo.EventBus.slnx -c Release -p:UseSharedCompilation=false -nr:false
dotnet build src/event-bus/Sparkdo.EventBus.slnx -c Release -p:UseSharedCompilation=false -nr:false
dotnet pack src/event-bus/Sparkdo.EventBus.slnx -c Release -p:UseSharedCompilation=false -nr:false
Product 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.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Sparkdo.EventBus:

Package Downloads
Sparkdo.Ddd.Domain

Sparkdo DDD 领域模型库,提供领域驱动设计的核心组件实现

Sparkdo.EventBus.RabbitMQ

Sparkdo RabbitMQ 事件总线实现,提供基于 RabbitMQ 的分布式事件发布和订阅功能

Sparkdo.Users.Abstractions

Sparkdo 用户管理抽象库,提供用户管理功能的核心接口定义和事件定义

Sparkdo.EventBus.Kafka

Sparkdo Kafka 事件总线实现,提供基于 Kafka 的分布式事件发布和订阅功能

Sparkdo.EventBus.StackExchangeRedis

Sparkdo 基于 StackExchange.Redis 的分布式事件总线实现,使用 Redis 的 Pub/Sub 机制实现分布式事件的发布和订阅功能

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.2 44 7/20/2026
1.0.4-preview.3 189 6/8/2026
1.0.4-preview.2 192 6/7/2026
1.0.4-preview.1 185 6/7/2026
1.0.3 425 6/6/2026
1.0.3-preview.1 182 5/17/2026
1.0.2 344 4/27/2026
1.0.2-preview.5 108 4/15/2026
1.0.2-preview.4 109 2/8/2026
1.0.2-preview.3 121 2/1/2026
1.0.2-preview.2 141 1/31/2026
1.0.2-preview.1 219 12/4/2025
1.0.1 988 11/27/2025
1.0.0 948 11/25/2025
1.0.0-preview.5 167 10/24/2025