Skip to content

Event Handling

Overview

  • Event Flow

    Understanding how events flow through the system from handlers to processing.

    Read More

  • Runtime Processing

    How events are processed synchronously in the same request context.

    Read More

  • Parallel Processing

    Configuring parallel event processing with concurrency limits.

    Read More

  • Event Types

    DomainEvent vs NotificationEvent and when to use each type.

    Read More

  • Examples

    Complete examples of event handling patterns.

    Read More

  • Best Practices

    Best practices and recommendations for event handling.

    Read More

Event handlers process domain events that are emitted from command handlers. These events represent something that happened in the domain and trigger side effects like sending notifications, updating read models, or triggering other workflows.

When a command handler processes a request, it can emit domain events through the events property. These events are automatically collected and processed by event handlers registered in the system.

Aspect Description
Runtime Processing Events are processed synchronously in the same request context, not asynchronously
Automatic Dispatch Events are automatically dispatched to registered handlers after command execution
Parallel Support Multiple events can be processed in parallel with configurable concurrency limits
Side Effects Event handlers perform side effects without blocking the main command flow

Prerequisites

Understanding of Request Handlers and Bootstrap is required. Events are emitted by command handlers and processed by event handlers.

Related Topics