Naravel.Events 0.2.0

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

Naravel.Events

NuGet Downloads .NET 10 License: MIT

Typed event dispatcher with listener ordering, stop propagation, and optional queue adapter support.

Fact Detail
Install dotnet add package Naravel.Events
Targets .NET 10
Needs No other Naravel package
Add-on Naravel.Events.Queue runs selected listeners through Naravel.Queue

What you get

  • Typed, asynchronous dispatch. DispatchAsync(new OrderPaid(...)) runs every listener of exactly that event type, in order, before it returns.
  • Listeners are ordinary DI services. You implement IEventListener<T> and register it explicitly.
  • Deterministic order and stop propagation. EventDispatchContext.Stop() skips the remaining listeners.
  • Queued listeners. With Naravel.Events.Queue, selected listeners run through Naravel.Queue.
  • Observable. A Meter and an ActivitySource, both named Naravel.Events, report dispatched and failed events and the dispatch duration.

Quick start

using Naravel.Events;

builder.Services.AddNaravelEvents();
builder.Services.AddScoped<IEventListener<OrderPaid>, WriteAuditLine>();   // a listener is an ordinary DI service

app.MapPost("/orders/{id}/pay", async (string id, IEventDispatcher events, CancellationToken ct) =>
{
    await events.DispatchAsync(new OrderPaid(id, 42m), ct);   // every listener of OrderPaid has run when this returns
    return Results.Ok($"Order {id} paid");
});

public sealed record OrderPaid(string OrderId, decimal Total);

public sealed class WriteAuditLine : IEventListener<OrderPaid>
{
    public Task HandleAsync(OrderPaid evt, EventDispatchContext context, CancellationToken cancellationToken = default)
    {
        Console.WriteLine($"audit: order {evt.OrderId} paid, total {evt.Total}");
        return Task.CompletedTask;
    }
}
Package Adds
Naravel.Events.Queue Runs selected event listeners through Naravel.Queue

Learn more

Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.

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 (2)

Showing the top 2 NuGet packages that depend on Naravel.Events:

Package Downloads
Naravel.Events.Queue

Optional Naravel.Events adapter for running selected event listeners through Naravel.Queue.

Naravel.Broadcasting

Typed real-time broadcasting over SignalR for Naravel: IBroadcastable events, channel authorization rules, signalr/log/null drivers and a test fake, built on Naravel.Foundation and Naravel.Events.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 299 11/13/2026
0.1.1 128 11/2/2026
0.1.0 125 11/1/2026