Clean Architecture Demo
Loading...
Searching...
No Matches
TaskManagement.Infrastructure.EventDispatching.InProcessDomainEventDispatcher Class Referencesealed

InProcessDomainEventDispatcher entrega cada evento del dominio a sus manejadores, en el mismo proceso y en el mismo alcance de la solicitud. More...

Inheritance diagram for TaskManagement.Infrastructure.EventDispatching.InProcessDomainEventDispatcher:
Collaboration diagram for TaskManagement.Infrastructure.EventDispatching.InProcessDomainEventDispatcher:

Public Member Functions

 InProcessDomainEventDispatcher (IServiceProvider serviceProvider)
async Task DispatchAsync (IReadOnlyCollection< DomainEvent > events, CancellationToken cancellationToken=default)

Detailed Description

InProcessDomainEventDispatcher entrega cada evento del dominio a sus manejadores, en el mismo proceso y en el mismo alcance de la solicitud.

Rol en Clean Architecture:

  • Parte de la capa de Infraestructura
  • Implementa IDomainEventDispatcher -definida en la capa de aplicación-
  • Encapsula el uso del contenedor de inyección de dependencias para encontrar los manejadores: la capa de aplicación no lo conoce
  • Podría reemplazarse por otra implementación, por ejemplo, una cola de mensajes, sin cambiar los casos de uso

Los manejadores implementan IDomainEventSubscriber y se registran en Program.cs.

Definition at line 26 of file InProcessDomainEventDispatcher.cs.

Constructor & Destructor Documentation

◆ InProcessDomainEventDispatcher()

TaskManagement.Infrastructure.EventDispatching.InProcessDomainEventDispatcher.InProcessDomainEventDispatcher ( IServiceProvider serviceProvider)

Definition at line 30 of file InProcessDomainEventDispatcher.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ DispatchAsync()

async Task TaskManagement.Infrastructure.EventDispatching.InProcessDomainEventDispatcher.DispatchAsync ( IReadOnlyCollection< DomainEvent > events,
CancellationToken cancellationToken = default )

The documentation for this class was generated from the following file: