Skip to content

Mediator Enhancments - #181

Merged
eneshoxha merged 5 commits into
v3.0/releasefrom
v3/feature/mediator-enhancments
Jan 25, 2026
Merged

Mediator Enhancments#181
eneshoxha merged 5 commits into
v3.0/releasefrom
v3/feature/mediator-enhancments

Conversation

@eneshoxha

Copy link
Copy Markdown
Contributor

v3/feature/#175: Introduce INotificationPipelineBehavior for notifications, enabling middleware-style behaviors (e.g., logging, error handling) around notification handlers. Update MediatorOptions and DI registration to support open and closed notification behaviors. Refactor PublishAsync to execute handlers through the pipeline. Add LoggingNotificationBehavior example and comprehensive tests for pipeline execution and integration. Brings notification handling in line with command/query pipelines.

Introduce INotificationPipelineBehavior<TNotification> for notifications, enabling middleware-style behaviors (e.g., logging, error handling) around notification handlers. Update MediatorOptions and DI registration to support open and closed notification behaviors. Refactor PublishAsync to execute handlers through the pipeline. Add LoggingNotificationBehavior example and comprehensive tests for pipeline execution and integration. Brings notification handling in line with command/query pipelines.
@eneshoxha eneshoxha self-assigned this Jan 25, 2026
@eneshoxha eneshoxha added the feature This label is in use for minor version increments label Jan 25, 2026
@eneshoxha eneshoxha added this to the Cortex v3.0 milestone Jan 25, 2026
Introduced exception handling pipeline behaviors for commands, queries, and notifications, including ExceptionHandlingCommandBehavior, ExceptionHandlingVoidCommandBehavior, ExceptionHandlingQueryBehavior, and ExceptionHandlingNotificationBehavior. Added IExceptionHandler and IExceptionHandler<TResult> interfaces for custom exception handling and fallback results. Provided default handlers, DI registration extensions, and comprehensive unit/integration tests. Updated README with usage, configuration, and code samples.
@eneshoxha eneshoxha linked an issue Jan 25, 2026 that may be closed by this pull request
…and tests

Introduces a caching pipeline behavior for queries, supporting both the [Cacheable] attribute and ICacheableQuery interface for flexible cache control. Adds ICacheKeyGenerator (with default implementation) for cache key generation and ICacheInvalidator for manual cache invalidation. Provides CachingOptions for configuration and DI extensions for easy setup. Updates README with usage docs and adds comprehensive unit/integration tests. Project files updated to include required caching packages.
@eneshoxha eneshoxha linked an issue Jan 25, 2026 that may be closed by this pull request
Introduces IStreamQuery, streaming handlers, and pipeline behaviors for efficient IAsyncEnumerable-based queries. Adds built-in logging behavior, DI registration, and new IMediator streaming APIs. Includes docs and comprehensive tests for streaming, pipeline, and cancellation scenarios.
@eneshoxha eneshoxha linked an issue Jan 25, 2026 that may be closed by this pull request
…iator

Introduces IRequestPreProcessor and IRequestPostProcessor interfaces for running logic before and after handlers, supporting both commands/queries with and without responses. Implements corresponding pipeline behaviors for commands, queries, and notifications. Updates DI extensions for automatic processor registration and adds `.AddProcessorBehaviors()` to options. Enhances documentation with usage examples and adds comprehensive unit and integration tests. This is a non-breaking, opt-in addition.
@eneshoxha eneshoxha linked an issue Jan 25, 2026 that may be closed by this pull request
@eneshoxha
eneshoxha merged commit 191b8c9 into v3.0/release Jan 25, 2026
@eneshoxha
eneshoxha deleted the v3/feature/mediator-enhancments branch January 25, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment