EricksonLopez.Events

dotnet-events · Mensajería y Eventos

En esta página (20 secciones)

1. Identidad, Nivel y Perfil de Madurez#

L0 Primitivas FundamentalesEstableMantenimiento: ActivoAOT: CompletoLicencia MITConfianza: HIGH
DomainApplicationnet8.0net9.0net10.0

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
También publicado en esta familia:
EricksonLopez.Events.ContractsEricksonLopez.Events.TestingEricksonLopez.Events.Serialization.SystemTextJsonEricksonLopez.Events.CloudEventsEricksonLopez.Events.OpenTelemetryEricksonLopez.Events.Generators

4. Métricas Verificadas del Ecosistema#

v2.0.0
Versión Publicada en NuGet
v2.0.0
Versión HEAD del Repo
6,051
Descargas en NuGet
7
Paquetes Empaquetables
381
Miembros Públicos de API
13
Filas Benchmark (RyuJIT)

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 PaqueteEstadoNuGet / LocalTFMsEstado AOTDescargasDescripción
EricksonLopez.EventsPrincipalPublicadov2.0.0 / v2.0.0net8.0, net9.0, net10.0AOT: Completo398Event dispatching, bus orchestration and ambient pipeline primitives for decoupled, event-driven .NET applications, designed for trimming and Native AOT.
EricksonLopez.Events.ContractsPublicadov2.0.0 / v2.0.0net8.0, net9.0, net10.0AOT: Completo4,095Pure domain-level event contracts and identifiers for decoupled, event-driven .NET applications. Zero third-party dependencies.
EricksonLopez.Events.TestingPublicadov2.0.0 / v2.0.0net8.0, net9.0, net10.0AOT: Completo428Testing utilities and fake event publishers/handlers for EricksonLopez.Events.
EricksonLopez.Events.Serialization.SystemTextJsonPublicadov2.0.0 / v2.0.0net8.0, net9.0, net10.0AOT: Completo298System.Text.Json Native AOT converters and serialization adapters for EricksonLopez.Events.
EricksonLopez.Events.CloudEventsPublicadov2.0.0 / v2.0.0net8.0, net9.0, net10.0AOT: Completo291CloudEvents 1.0 adapter and bidirectional mapping extensions for EricksonLopez.Events, supporting CNCF standard event gateways and Native AOT.
EricksonLopez.Events.OpenTelemetryPublicadov2.0.0 / v2.0.0net8.0, net9.0, net10.0AOT: Completo273OpenTelemetry instrumentation extensions for EricksonLopez.Events. Enables distributed tracing and metrics integration with OpenTelemetry .NET SDK.
EricksonLopez.Events.GeneratorsAnalizador / GeneradorPublicadov2.0.0 / v2.0.0netstandard2.0AOT: N/A (Analizador/Legado)268Roslyn 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#

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
Topología de Dependencias de EricksonLopez.Events0 dependencias hacia librerías aguas arriba y 4 librerías dependientes aguas abajo verificadas en dependencies.json.
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ónLibreríaNivelTipos de Relación
Aguas abajoEricksonLopez.SharedKernelL1Tiempo de compilación, Paquete NuGet
Aguas abajoEricksonLopez.MessagingL3Tiempo de compilación, Paquete NuGet
Aguas abajoEricksonLopez.OutboxL3Tiempo de compilación, Paquete NuGet
Aguas abajoEricksonLopez.ProcessesL4Tiempo 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_events

10. 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 PaqueteIsAotCompatibleEnableTrimAnalyzerEstado AOT VerificadoTarget Frameworks
EricksonLopez.EventstruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Events.ContractstruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Events.TestingtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Events.Serialization.SystemTextJsontruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Events.CloudEventstruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Events.OpenTelemetrytruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Events.GeneratorsnullnullNotApplicablenetstandard2.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)

Microsoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.Logging.AbstractionsOpenTelemetry

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.AddEventBus

    Registers 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.ConfigureForCloudEvents

    Configures `JsonSerializerOptions` with CloudEvents v1.0 standard settings.

  • EventsOpenTelemetryExtensions.AddEventsInstrumentation

    Adds event metrics instrumentation to the meter provider.

  • EventsJsonSerializerOptionsExtensions.AddEventsConverters

    Adds 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).

Filas totales: 13 · Medidos: 13 · NA / Error: 0 · Suites: 4

Runtimes observados: .NET 10.0.1 X64 RyuJIT x86-64-v3

CPUs observadas: 12th Gen Intel Core i7-12700K 3.60GHz, 1 CPU, 20 logical and 12 physical cores

SuiteMétodoRuntimeMedia (ns)Asignado (B)Estado
RegistryBenchmarksRegistry_TryGetDescriptor_ByType_N1.NET 10.0.1 X64 RyuJIT x86-64-v31.8080measured
RegistryBenchmarksRegistry_TryGetDescriptor_ByType_N10.NET 10.0.1 X64 RyuJIT x86-64-v31.8550measured
RegistryBenchmarksRegistry_TryGetDescriptor_ByType_N100.NET 10.0.1 X64 RyuJIT x86-64-v32.0880measured
RegistryBenchmarksStaticRegistry_GetDescriptor_Cached.NET 10.0.1 X64 RyuJIT x86-64-v36.2510measured
RegistryBenchmarksRegistry_TryGetDescriptor_ByEventType_N100.NET 10.0.1 X64 RyuJIT x86-64-v314.9390measured
EventBenchmarksEnvelope_Create.NET 10.0.1 X64 RyuJIT x86-64-v326.0280measured
DispatchScenariosBenchmarksPublish_1Handler.NET 10.0.1 X64 RyuJIT x86-64-v3205.7624measured
EventBusBenchmarksEventBus_Sequential_1Handler.NET 10.0.1 X64 RyuJIT x86-64-v3275.4840measured
DispatchScenariosBenchmarksPublish_5Handlers.NET 10.0.1 X64 RyuJIT x86-64-v3358.5624measured
DispatchScenariosBenchmarksPublish_10Handlers.NET 10.0.1 X64 RyuJIT x86-64-v3589.8624measured
DispatchScenariosBenchmarksPublish_50Handlers.NET 10.0.1 X64 RyuJIT x86-64-v32,353.4624measured
DispatchScenariosBenchmarksPublish_100Events_Sequential.NET 10.0.1 X64 RyuJIT x86-64-v334,160.362,401measured
DispatchScenariosBenchmarksPublish_1000Events_Sequential.NET 10.0.1 X64 RyuJIT x86-64-v3358,108624,013measured

15. Historial de Versiones y Estado NuGet vs Repositorio#

Las versiones de NuGet y del repositorio están alineadas.

VersiónOrigenFecha de PublicaciónResumen
v2.0.0 ↗github2026-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 ↗nuget2026-09-20Published EricksonLopez.Events 2.0.0 to NuGet.org.
v1.0.0 ↗github2026-08-25Ecosystem 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 ↗nuget2026-08-25Published EricksonLopez.Events 1.0.0 to NuGet.org.

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#

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).

Buscar en el Ecosistema EricksonLopez.*

Escribe el nombre de una librería, ID de paquete NuGet, tipo .NET o concepto arquitectónico para buscar en el portal.