EventFlux 1.1.5
dotnet add package EventFlux --version 1.1.5
NuGet\Install-Package EventFlux -Version 1.1.5
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="EventFlux" Version="1.1.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EventFlux" Version="1.1.5" />
<PackageReference Include="EventFlux" />
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 EventFlux --version 1.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EventFlux, 1.1.5"
#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.
#addin nuget:?package=EventFlux&version=1.1.5
#tool nuget:?package=EventFlux&version=1.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EventFlux
EventFlux is a lightweight, event-driven event handler library for .NET 8.0.
EventFlux is a lightweight, event-driven event handler library for .NET 8.0. It provides a simple way to trigger multiple events and handle them efficiently
Features
- Event-Based Architecture: Easily trigger and handle multiple events.
- Automatic Event Handler Discovery: Scans assemblies and registers handlers automatically.
- Lightweight & High Performance: Built for .NET 8.0 applications.
- Deferred Event Execution: Collect events in a list and trigger them all at once for optimized processing and better control over execution flow.
- Multiple Event Handlers Support: A single event can trigger multiple handlers.
- Pipeline Behaviors Support: Add custom middleware like logging, validation, and caching to the event processing pipeline.
- Dynamic Event Dispatching: Route events dynamically to different handlers.
Installation
You can install EventFlux via NuGet Package Manager:
Injection
var builder = WebApplication.CreateBuilder(args);
// optionals
//builder.Services.AddEventLogging();
//builder.Services.AddEventTimeout();
builder.Services.AddEventBus(AssemblyReference.Assemblies).AddEventLogging().AddEventTimeout();
builder.Services.AddEventDispatcher();
var app = builder.Build();
app.Run();
Use Example
public class ExampleController(IEventBus _eventBus) : ControllerBase
{
[HttpPost("create-user")]
public async Task<IActionResult> CreateUser([FromBody] CreateUserCommandRequest command)
{
CreateUserCommandResponse response = await _eventBus.SendAsync(command);
return Ok(response);
}
}
Use Event Dispatcher
public class ValidationBehavior<TRequest, TResponse>: IEventCustomPipeline<TRequest, TResponse>
where TRequest : IEventRequest<TResponse>
where TResponse : IEventResponse
{
public async Task<TResponse> Handle(
TRequest request,
EventHandlerDelegate<TResponse> next,
CancellationToken cancellationToken)
{
Console.WriteLine($"Validating {typeof(TRequest).Name}");
return await next();
}
}
Use Example
public class ExampleController(IEventDispatcher _eventDispatcher) : ControllerBase
{
[HttpPost("update-user")]
public async Task<IActionResult> UpdateUser([FromBody] UpdateUserCommandRequest command)
{
UpdateUserCommandResponse response = await _eventDispatcher.SendAsync(command);
return Ok(response);
}
}
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EventFlux:
Package | Downloads |
---|---|
EventFlux.RabbitFlow
It is a library combined with rabbitmq and ventflux libraries. The library functions as a distributed event handler. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release with event-based CQRS support.