Cosmos.EventDriven.Abstractions 0.0.4

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

Cosmos.EventDriven.Abstractions

NuGet

Abstracciones fundamentales para implementar Event Driven Architecture (EDA) en .NET 10.

Descripción

Este paquete proporciona las interfaces base necesarias para construir aplicaciones basadas en arquitecturas orientadas a eventos. Define contratos claros para la publicación de eventos y su integración con el estándar CloudEvents.

Características

  • IEventSender: Interfaz para publicar eventos de manera asíncrona
  • IPublicEvent: Marcador de interfaz para eventos públicos
  • Integración con CloudEvents (v2.8.0)
  • Sin dependencias de implementación concreta

Instalación

dotnet add package Cosmos.EventDriven.Abstractions

Uso

Definir un Evento Público

using Cosmos.EventDriven.Abstractions;

public record UserRegistered(
    string UserId,
    string Email,
    DateTime RegisteredAt
) : IPublicEvent;

Implementar un Event Sender

using Cosmos.EventDriven.Abstractions;

public class MyEventSender : IEventSender
{
    public async Task PublishEventAsync(IPublicEvent @event)
    {
        // Tu implementación para publicar el evento
        // Por ejemplo: enviar a RabbitMQ, Azure Service Bus, etc.
    }
}

Publicar un Evento

public class UserService
{
    private readonly IEventSender _eventSender;

    public UserService(IEventSender eventSender)
    {
        _eventSender = eventSender;
    }

    public async Task RegisterUser(string userId, string email)
    {
        // Lógica de negocio...

        var @event = new UserRegistered(userId, email, DateTime.UtcNow);
        await _eventSender.PublishEventAsync(@event);
    }
}

Integración con CloudEvents

Este paquete está diseñado para trabajar con el estándar CloudEvents, permitiendo interoperabilidad entre diferentes sistemas y plataformas.

Implementaciones Concretas

Para una implementación lista para usar con Wolverine y RabbitMQ, consulta el paquete Cosmos.EventSourcing.CritterStack.

Requisitos

  • .NET 10.0 o superior

Dependencias

  • CloudNative.CloudEvents (v2.8.0)

Licencia

Copyright © Cosmos. Todos los derechos reservados.

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

Showing the top 1 NuGet packages that depend on Cosmos.EventDriven.Abstractions:

Package Downloads
Cosmos.Compras.Contratos

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 198 12/3/2025
0.0.3 203 11/25/2025
0.0.1 392 9/19/2025