LightMediator.EventBus
0.5.1.12
dotnet add package LightMediator.EventBus --version 0.5.1.12
NuGet\Install-Package LightMediator.EventBus -Version 0.5.1.12
<PackageReference Include="LightMediator.EventBus" Version="0.5.1.12" />
<PackageVersion Include="LightMediator.EventBus" Version="0.5.1.12" />
<PackageReference Include="LightMediator.EventBus" />
paket add LightMediator.EventBus --version 0.5.1.12
#r "nuget: LightMediator.EventBus, 0.5.1.12"
#addin nuget:?package=LightMediator.EventBus&version=0.5.1.12
#tool nuget:?package=LightMediator.EventBus&version=0.5.1.12
LightMediator.EventBus
LightMediator.EventBus is an extension of the LightMediator library that provides support for EventBus-style communication between services, applications, or distributed components in a decoupled and efficient way.
✨ Features
- 🔁 Publish-Subscribe pattern built on top of LightMediator
- 🧩 Extensible architecture – plug into different transport layers (e.g., RabbitMQ, Azure Service Bus, SignalR, etc.)
- 🛠️ Seamless integration with existing LightMediator pipelines
- 📦 Lightweight and performant – zero external dependencies unless needed by transport
- ✅ Unit-test friendly design
📦 Installation
Install via NuGet:
dotnet add package LightMediator.EventBus
🚀 Getting Started
public class OrderCreatedEvent : IEvent
{
public Guid OrderId { get; init; }
}
public class OrderCreatedHandler : IEventHandler<OrderCreatedEvent>
{
public Task HandleAsync(OrderCreatedEvent @event, CancellationToken cancellationToken)
{
Console.WriteLine($"Order created: {@event.OrderId}");
return Task.CompletedTask;
}
}
Then register the EventBus in your DI container:
services.AddLightMediator(options => // from LightMediator
{
// Configure options for the mediator
options.IgnoreNamespaceInAssemblies = true;
options.IgnoreNotificationDifferences = true;
options.RegisterNotificationsByAssembly = true;
options.RegisterRequestsByAssembly = true;
// specify the assemblies to scan for notifications
options.Assemblies = new[]
{
Assembly.GetExecutingAssembly(),
Lib1.GetServiceAssembly(),
Lib2.GetServiceAssembly(),
Service1.GetServiceAssembly()
};
options.AddLightMediatorEventBus(services); // from this package
},
Publish an event: Use PublishEvent extension method for light mediator to publish cross domain events
await lightMediator.PublishEvent(new OrderCreatedEvent { OrderId = Guid.NewGuid() });
🧱 Architecture
This library follows a simple EventBus pattern and leverages the core pipeline and handler resolution features of LightMediator. It abstracts away transport-specific logic so developers can focus on events and handlers.
📄 Dependencies
This package depends on:
LightMediator
: A minimalistic and performant in-process mediator pattern library for .NET.
✅ Contributing
Contributions are welcome! Please feel free to open issues, submit pull requests, or suggest enhancements.
📝 License
This project is licensed under the MIT License.
💬 Contact
For support or questions, feel free to reach out via GitHub Issues or contact @omidmloo.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- LightMediator (>= 0.5.1.4)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on LightMediator.EventBus:
Package | Downloads |
---|---|
LightMediator.EventBus.SignalR
Signalr messaging service extension for lightmediator event bus |
|
LightMediator.EventBus.RabbitMQ
RabbitMQ messaging service extension for lightmediator event bus |
|
LightMediator.EventBus.MQTT
MQTT messaging service extension for lightmediator event bus |
|
LightMediator.EventBus.AzureServiceBus
Azure Service Bus messaging service extension for lightmediator event bus |
GitHub repositories
This package is not used by any popular GitHub repositories.
- Update readme and documentation
- correct project urls