Class NotificationDispatchOptions
- Namespace
- SimpleMediator
- Assembly
- SimpleMediator.dll
Configuration options for notification dispatch behavior.
public sealed class NotificationDispatchOptions
- Inheritance
-
NotificationDispatchOptions
- Inherited Members
Examples
services.AddSimpleMediator(config =>
{
config.NotificationDispatch.Strategy = NotificationDispatchStrategy.Parallel;
config.NotificationDispatch.MaxDegreeOfParallelism = 4;
});
Remarks
Controls how notifications are dispatched to multiple handlers.
By default, notifications are dispatched sequentially with fail-fast semantics. Parallel dispatch can be enabled for improved throughput when handlers are independent.
Properties
MaxDegreeOfParallelism
Gets or sets the maximum degree of parallelism for parallel strategies. Default is -1 (uses ProcessorCount).
public int MaxDegreeOfParallelism { get; set; }
Property Value
Remarks
Only applies when Strategy is Parallel or ParallelWhenAll.
Strategy
Gets or sets the dispatch strategy for notifications. Default is Sequential.
public NotificationDispatchStrategy Strategy { get; set; }