EricksonLopez.Events
dotnet-events · Mensajería y Eventos
En esta página (20 secciones)
1. Identidad, Nivel y Perfil de Madurez#
2. Propuesta de Valor y Problema que Resuelve#
Event contracts and primitives for building decoupled, event-driven .NET applications, designed for trimming and Native AOT
Las librerías de eventos basadas en reflexión asignan delegados y diccionarios en heap en cada despacho, generando presión de GC y rompiendo el trimming.
3. Instalación Rápida#
Paquete principal: EricksonLopez.Events
dotnet add package EricksonLopez.Events --version 2.0.0<PackageReference Include="EricksonLopez.Events" Version="2.0.0" /><PackageVersion Include="EricksonLopez.Events" Version="2.0.0" />4. Métricas Verificadas del Ecosistema#
Instantánea recuperada UTC: 2026-12-01
5. Cuándo Usar y Cuándo NO Usar#
Cuándo usar
- Necesitas contratos L0 de eventos de dominio/integración (IDomainEvent, EventEnvelope<TEvent>) y despacho in-process con ValueTask.
- Requieres identificadores EventId monotónicos RFC 9562 y serialización JSON compatible con CNCF CloudEvents v1.0.
Cuándo NO usar
- Necesitas entrega durable mediante broker entre reinicios de proceso; combina con EricksonLopez.Outbox o EricksonLopez.Messaging.
6. Capacidades Principales e Invariantes de Diseño#
Despacho In-Process con ValueTask
Soporta SequentialExecutionStrategy y ParallelExecutionStrategy con políticas FailFast o AggregateAndContinue.
EventEnvelope y CloudEvents v1.0
Transporta correlación, causalidad, identidad de tenant y conversión bidireccional con CloudEvents v1.0.
OpenTelemetry y Metadatos Generados
Provee instrumentación EventBusDiagnostics y descubrimiento de handlers seguro para trimming.
7. Paquetes NuGet y Adaptadores Incluidos#
| ID del Paquete | Estado | NuGet / Local | TFMs | Estado AOT | Descargas | Descripción |
|---|---|---|---|---|---|---|
| EricksonLopez.EventsPrincipal | Publicado | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 398 | Event dispatching, bus orchestration and ambient pipeline primitives for decoupled, event-driven .NET applications, designed for trimming and Native AOT. |
| EricksonLopez.Events.Contracts | Publicado | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 4,095 | Pure domain-level event contracts and identifiers for decoupled, event-driven .NET applications. Zero third-party dependencies. |
| EricksonLopez.Events.Testing | Publicado | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 428 | Testing utilities and fake event publishers/handlers for EricksonLopez.Events. |
| EricksonLopez.Events.Serialization.SystemTextJson | Publicado | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 298 | System.Text.Json Native AOT converters and serialization adapters for EricksonLopez.Events. |
| EricksonLopez.Events.CloudEvents | Publicado | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 291 | CloudEvents 1.0 adapter and bidirectional mapping extensions for EricksonLopez.Events, supporting CNCF standard event gateways and Native AOT. |
| EricksonLopez.Events.OpenTelemetry | Publicado | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Completo | 273 | OpenTelemetry instrumentation extensions for EricksonLopez.Events. Enables distributed tracing and metrics integration with OpenTelemetry .NET SDK. |
| EricksonLopez.Events.GeneratorsAnalizador / Generador | Publicado | v2.0.0 / v2.0.0 | netstandard2.0 | AOT: N/A (Analizador/Legado) | 268 | Roslyn Incremental Source Generator for EricksonLopez.Events to generate zero-reflection compile-time event registries and descriptors. |
8. Ejemplo Quick Start#
Basado en APIs públicas verificadas de EricksonLopez.Events. Compila con `<ImplicitUsings>disable</ImplicitUsings>` e importaciones explícitas.
using System;
using EricksonLopez.Events.Contracts;
using EricksonLopez.Events.Identifiers;
public sealed record OrderPlacedDomainEvent(
EventId Id,
Guid OrderId,
Guid CustomerId,
decimal TotalAmount,
string Currency,
DateTimeOffset OccurredAt) : IDomainEvent;9. Arquitectura y Flujo de Dependencias#
Renderizando diagrama…
flowchart LR lib_events["EricksonLopez.Events (L0)"] lib_shared_kernel["EricksonLopez.SharedKernel (L1)"] lib_shared_kernel --> lib_events lib_messaging["EricksonLopez.Messaging (L3)"] lib_messaging --> lib_events lib_outbox["EricksonLopez.Outbox (L3)"] lib_outbox --> lib_events lib_processes["EricksonLopez.Processes (L4)"] lib_processes --> lib_events
Ver descripción textual y tabla accesible
0 dependencias hacia librerías aguas arriba y 4 librerías dependientes aguas abajo verificadas en dependencies.json.
| Dirección | Librería | Nivel | Tipos de Relación |
|---|---|---|---|
| Aguas abajo | EricksonLopez.SharedKernel | L1 | Tiempo de compilación, Paquete NuGet |
| Aguas abajo | EricksonLopez.Messaging | L3 | Tiempo de compilación, Paquete NuGet |
| Aguas abajo | EricksonLopez.Outbox | L3 | Tiempo de compilación, Paquete NuGet |
| Aguas abajo | EricksonLopez.Processes | L4 | Tiempo de compilación, Paquete NuGet |
flowchart LR
lib_events["EricksonLopez.Events (L0)"]
lib_shared_kernel["EricksonLopez.SharedKernel (L1)"]
lib_shared_kernel --> lib_events
lib_messaging["EricksonLopez.Messaging (L3)"]
lib_messaging --> lib_events
lib_outbox["EricksonLopez.Outbox (L3)"]
lib_outbox --> lib_events
lib_processes["EricksonLopez.Processes (L4)"]
lib_processes --> lib_events10. Target Frameworks y Matriz Native AOT / Trimming#
Inspección MSBuild `.csproj` sobre 7 paquetes: 6 Full, 0 Partial, 0 Incompatible, 1 NotApplicable (analizadores/generadores).
| ID del Paquete | IsAotCompatible | EnableTrimAnalyzer | Estado AOT Verificado | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Events | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Contracts | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Testing | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Serialization.SystemTextJson | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.CloudEvents | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.OpenTelemetry | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Generators | null | null | NotApplicable | netstandard2.0 |
11. Dependencias Aguas Arriba y Dependientes Aguas Abajo#
Dependencias Aguas Arriba (0)
Cero dependencias cruzadas aguas arriba (nodo fundacional).
Dependientes Aguas Abajo (4)
12. Adaptadores Opcionales e Integraciones Externas#
Aristas de Adaptadores Internos y Paquetes de Integración
No se registran aristas de adaptadores opcionales ni paquetes de integración para esta librería.
Dependencias NuGet Externas Verificadas (3)
13. Resumen de Configuración y Registro en DI#
Puntos de Entrada DI y Configuración Verificados
EventBusServiceCollectionExtensions.AddEnvelopeEventHandler<TEvent, THandler>Registers a strongly typed envelope event handler into the service collection and handler registry.
EventBusServiceCollectionExtensions.AddEventBusRegisters core event bus services into the specified service collection.
EventBusServiceCollectionExtensions.AddEventHandler<TEvent, THandler>Registers a strongly typed event handler into the service collection and handler registry.
EventBusServiceCollectionExtensions.AddEventMiddleware<TMiddleware>Registers an event middleware into the pipeline with the specified lifetime.
CloudEventsJsonSerializerOptionsExtensions.ConfigureForCloudEventsConfigures `JsonSerializerOptions` with CloudEvents v1.0 standard settings.
EventsOpenTelemetryExtensions.AddEventsInstrumentationAdds event metrics instrumentation to the meter provider.
EventsJsonSerializerOptionsExtensions.AddEventsConvertersAdds Native AOT compatible event serialization converters to the options instance.
Tipos Públicos y Contratos Clave
EricksonLopez.Events.Attributes.EventNameAttribute (class)Specifies the explicit, transport-stable semantic name for an event type.
EricksonLopez.Events.Attributes.EventSourceAttribute (class)Specifies the originating producer source or URI for an event or all events in an assembly.
EricksonLopez.Events.Attributes.EventVersionAttribute (class)Specifies the explicit schema version of an event contract.
EricksonLopez.Events.Bus.EventBus (class)Provides an in-process event bus for dispatching events to registered handlers through a configurable middleware pipeline.
EricksonLopez.Events.Bus.Configuration.ErrorHandlingPolicy (enum)Specifies how exceptions arising from individual event handlers are managed during dispatch.
EricksonLopez.Events.Bus.Configuration.EventBusOptions (class)Provides configuration options for the in-process event bus.
EricksonLopez.Events.Bus.Configuration.EventExecutionMode (enum)Specifies how multiple handlers registered for the same event type are executed during dispatch.
EricksonLopez.Events.Bus.Configuration.HandlerScopePolicy (enum)Specifies the service provider scoping policy when resolving event handlers.
EricksonLopez.Events.Bus.Diagnostics.EventBusDiagnostics (class)Provides OpenTelemetry ActivitySource and Metrics instruments for the EventBus.
EricksonLopez.Events.Bus.Exceptions.EventDispatchException (class)Represents errors that occur when one or more event handlers fail during event dispatch.
EricksonLopez.Events.Bus.Execution.IExecutionStrategy (interface)Defines a strategy for executing event handlers during dispatch.
EricksonLopez.Events.Bus.Execution.ParallelExecutionStrategy (class)Executes all registered handlers for an event concurrently, collecting and aggregating any handler exceptions into a single `EventDispatchException`, or failing fast if configured.
14. Benchmarks de Rendimiento Verificados#
Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).
| Suite | Método | Runtime | Media (ns) | Asignado (B) | Estado |
|---|---|---|---|---|---|
| RegistryBenchmarks | Registry_TryGetDescriptor_ByType_N1 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 1.808 | 0 | measured |
| RegistryBenchmarks | Registry_TryGetDescriptor_ByType_N10 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 1.855 | 0 | measured |
| RegistryBenchmarks | Registry_TryGetDescriptor_ByType_N100 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 2.088 | 0 | measured |
| RegistryBenchmarks | StaticRegistry_GetDescriptor_Cached | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 6.251 | 0 | measured |
| RegistryBenchmarks | Registry_TryGetDescriptor_ByEventType_N100 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 14.939 | 0 | measured |
| EventBenchmarks | Envelope_Create | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 26.02 | 80 | measured |
| DispatchScenariosBenchmarks | Publish_1Handler | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 205.7 | 624 | measured |
| EventBusBenchmarks | EventBus_Sequential_1Handler | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 275.4 | 840 | measured |
| DispatchScenariosBenchmarks | Publish_5Handlers | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 358.5 | 624 | measured |
| DispatchScenariosBenchmarks | Publish_10Handlers | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 589.8 | 624 | measured |
| DispatchScenariosBenchmarks | Publish_50Handlers | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 2,353.4 | 624 | measured |
| DispatchScenariosBenchmarks | Publish_100Events_Sequential | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 34,160.3 | 62,401 | measured |
| DispatchScenariosBenchmarks | Publish_1000Events_Sequential | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 358,108 | 624,013 | measured |
15. Historial de Versiones y Estado NuGet vs Repositorio#
Las versiones de NuGet y del repositorio están alineadas.
| Versión | Origen | Fecha de Publicación | Resumen |
|---|---|---|---|
| v2.0.0 ↗ | github | 2026-09-20 | [2.0.0](https://github.com/ericksonlopezf/dotnet-events/compare/v1.0.0...v2.0.0) (2026-09-20) ⚠ BREAKING CHANGES * introduce event envelopes, execution context and versioned event infrastructure ✨ Features * introduce event envelopes, execution context and versioned event infrastructure ([30b20bc](https://github.com/ericksonlopezf/dotnet-events/commit/30b20bcfec2f7c13ef06b19555a9a8b455701f73)) |
| v2.0.0 ↗ | nuget | 2026-09-20 | Published EricksonLopez.Events 2.0.0 to NuGet.org. |
| v1.0.0 ↗ | github | 2026-08-25 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Events` | `1.0.0` | | `EricksonLopez.Events.Contracts` | `1.0.0` | | `EricksonLopez.Events.CloudEvents` | `1.0.0` | | `EricksonLopez.Events.Generators` | `1.0.0` | | `EricksonLopez.Events.OpenTelemetry` | `1.0.0` | | `EricksonLopez.Events.Serialization.SystemTextJson` | `1.0.0` | | `EricksonLopez.Eve... |
| v1.0.0 ↗ | nuget | 2026-08-25 | Published EricksonLopez.Events 1.0.0 to NuGet.org. |
16. Librerías Complementarias y Relacionadas#
Librerías en el mismo nivel, capa arquitectónica o vinculadas directamente mediante aristas de dependencia.
17. Documentación, API Reference y Enlaces del Portal#
Documentación Conceptual (Starlight) →
Referencia de API XML Extraída →
26 namespaces · 77 tipos · 381 miembros
Mapa de Dependencias del Ecosistema →
Centro de Aprendizaje y Manual →
Las páginas conceptuales por librería en Starlight se completan en M4; las páginas de API Reference en M3.2.
18. Repositorio Fuente, Licencia y Contribución#
Publicado bajo Licencia MIT. Todos los ensamblados cumplen los invariantes de compilación EricksonLopez.*: importaciones explícitas, firma fuerte (`EricksonLopez.snk`) y metadatos de autor en ASCII (`Erickson Lopez`).
19. Resolución de Problemas, Riesgos y Migración#
- Registra EventBus mediante AddEventBus() y llamadas explícitas AddEventHandler<TEvent, THandler>() para comportamiento determinista en Native AOT.
20. Evidencia de Calidad y Verificación#
- Firma Fuerte (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- Extracción de Documentación XML
- Verificado (26 namespaces, 77 tipos, 381 miembros)
- Atributos MSBuild AOT / Trimming
- 6 Full / 0 Partial / 0 Incompatible / 1 N/A
- Artefactos BenchmarkDotNet
- 13 total (13 measured, 0 na_error)
Límites Explícitos de Verificación y Alcance
- Todas las mediciones verificadas provienen estrictamente de `BenchmarkDotNet.Artifacts` ejecutados sobre .NET RyuJIT (existen 0 ejecuciones NativeAOT en esta instantánea).