M.EventBrokerSlim
1.0.0-preview1
See the version list below for details.
dotnet add package M.EventBrokerSlim --version 1.0.0-preview1
NuGet\Install-Package M.EventBrokerSlim -Version 1.0.0-preview1
<PackageReference Include="M.EventBrokerSlim" Version="1.0.0-preview1" />
<PackageVersion Include="M.EventBrokerSlim" Version="1.0.0-preview1" />
<PackageReference Include="M.EventBrokerSlim" />
paket add M.EventBrokerSlim --version 1.0.0-preview1
#r "nuget: M.EventBrokerSlim, 1.0.0-preview1"
#:package M.EventBrokerSlim@1.0.0-preview1
#addin nuget:?package=M.EventBrokerSlim&version=1.0.0-preview1&prerelease
#tool nuget:?package=M.EventBrokerSlim&version=1.0.0-preview1&prerelease
EventBrokerSlim
An implementation of broadcasting events in a fire-and-forget style.
- in-memory, in-process
- publishing is Fire and Forget style
- events don't need to implement specific interface
- events are handled on a ThreadPool threads
- tightly integrated with Microsoft.Extensions.DependencyInjection
- each handler is resolved and runned in a new DI container scope
How does it work
Implement an event handler by implementing IEventHadler<TEvent> interface:
public record SomeEvent(string Message);
public class SomeEventHandler : IEventHandler<SomeEvent>
{
// Inject services added to the DI container
public SomeEventHandler()
{
}
public async Task Handle(SomeEvent @event)
{
// process the event
}
public Task OnError(Exception exception, SomeEvent @event)
{
// called on unhandled exeption from Handle
}
}
Add event broker impelementation to DI container using AddEventBroker extension method and register handlers:
serviceCollection.AddEventBroker(
x => x.AddKeyedTransient<SomeEvent, SomeEventHandler>());
Inject IEventBroker and publish events:
class MyClass
{
private readonly IEventBroker _eventBroker;
public MyClass(IEventBroker eventBroker)
{
_eventBroker = eventBroker;
}
public async Task DoSomething()
{
var someEvent = new SomeEvent("Something happened");
await _eventBroker.Publish(someEvent);
}
}
| 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 was computed. 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. |
-
net8.0
NuGet packages (6)
Showing the top 5 NuGet packages that depend on M.EventBrokerSlim:
| Package | Downloads |
|---|---|
|
M.EventBrokerSlim.PersistentEvents.PostgreSql
PostgreSQL persistent events for EventBrokerSlim. |
|
|
M.EventBrokerSlim.PersistentEvents.Redis
Redis persistent events for EventBrokerSlim. |
|
|
M.EventBrokerSlim.PersistentEvents.SqlServer
SqlServer persistent events for EventBrokerSlim. |
|
|
M.EventBrokerSlim.PersistentEvents.Sqlite
SQLite persistent events for EventBrokerSlim. |
|
|
M.EventBrokerSlim.PersistentEvents.MongoDb
MongoDB persistent events for EventBrokerSlim. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.1 | 113 | 5/16/2026 |
| 5.0.0 | 345 | 4/16/2026 |
| 4.1.2 | 191 | 12/31/2025 |
| 4.1.1 | 584 | 6/1/2025 |
| 4.1.0 | 228 | 5/28/2025 |
| 4.0.0 | 229 | 5/11/2025 |
| 3.3.0 | 771 | 11/23/2024 |
| 3.2.0 | 522 | 9/14/2024 |
| 3.1.0 | 615 | 6/29/2024 |
| 3.0.0 | 471 | 5/2/2024 |
| 2.0.0 | 186 | 5/1/2024 |
| 1.0.0 | 771 | 1/12/2024 |
| 1.0.0-preview3 | 187 | 1/6/2024 |
| 1.0.0-preview2 | 200 | 1/1/2024 |
| 1.0.0-preview1 | 234 | 12/28/2023 |