Skip to content
CAI
Software that uses CAICheck a score

hasanxdev/DispatchR

50.0

Adequate · 21 September 2026

2.4k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

DispatchR is a .NET mediator library that facilitates request handling, notification publishing, and streaming responses within dependency injection containers. It provides configurable handler filtering, explicit pipeline behavior ordering, and dedicated abstractions to decouple contracts from implementation. The system includes validation for configuration errors and supports both synchronous and asynchronous execution models across multiple .NET versions.

Features

Add Aspire modular example with handler filtering

Added a new example project demonstrating how to use DispatchR's handler filtering features in a modular architecture. The example includes two services (ServiceA and ServiceB) that share a common modules assembly but selectively register handlers: ServiceA excludes the PongHandler, while ServiceB includes only the PongHandler. An Aspire AppHost project orchestrates both services, allowing users to test the filtered handler behavior via HTTP endpoints.

src/AspireModularExample · high confidence

Added benchmark suite for Mediator, MediatR, and DispatchR

The \src/Benchmark\ project now includes a comprehensive performance comparison suite for three mediator implementations: the native \Mediator\, \MediatR\, and \DispatchR\. The benchmarks evaluate request sending (with and without pipeline behaviors), stream requests, and notification publishing (single and multi-handler scenarios) to measure throughput and memory allocation differences across these libraries.

src/Benchmark · high confidence

Added sample stream request handlers and pipeline behaviors

The sample application now includes support for streaming requests, demonstrated by new files in the StreamRequest directory. This includes a CounterStreamRequest implementing IStreamRequest, a CounterStreamHandler that reads lines from a file asynchronously, and two pipeline behaviors (CounterPipelineStreamHandler and GenericPipelineBehavior) that wrap the stream handling logic.

src/Sample/DispatchR/StreamRequest · high confidence

Initial DI registration for DispatchR with handler filtering and configuration options

The \ServiceCollectionExtensions\ class now provides the entry point for registering DispatchR services. Users can configure the library via \ConfigurationOptions\, specifically setting \IncludeHandlers\ and \ExcludeHandlers\ to filter which handlers are registered. The registration process validates that these filter lists are not empty, throwing specific exceptions if they are. It supports registering pipelines and notifications based on boolean flags and respects a \PipelineOrder\ configuration. The extension scans specified assemblies for request handlers, stream request handlers, pipeline behaviors, and notification handlers, registering them appropriately via the \ServiceRegistrator\.

src/DispatchR/Extensions · high confidence

Sample app adds request pipelines, notifications, and streaming support

The MediatR sample project now demonstrates three core capabilities: request handling with generic and specific pipeline behaviors (FirstPipelineBehavior, SecondPipelineBehavior, GenericPipelineBehavior) applied to a Ping request; notification dispatch with a MultiHandlersNotification and its corresponding handlers (NotificationOneHandler, NotificationTwoHandler, NotificationThreeHandler); and streaming responses via CounterStreamRequest, CounterStreamHandler, and CounterPipelineStreamHandler.

src/Sample/MediatR · high confidence

Removals

Removal of MediatR vs DispatchR benchmark suite

The benchmark project that compared the performance of MediatR against DispatchR has been removed. This includes the deletion of the benchmark runner entry point, the specific benchmark classes for both standard and pipeline-based request handling, and the associated request/handler definitions for both libraries.

Benchmark · high confidence

Architecture

Mediator abstractions moved to a dedicated package

The core interfaces for the mediator pattern—including \IMediator\, \IRequest\, \INotification\, and their respective handlers and pipeline behaviors—have been extracted into the \DispatchR.Abstractions\ package. This change decouples the contract definitions from the implementation, allowing consumers to depend only on the lightweight abstractions without pulling in the full mediator logic.

src/DispatchR.Abstractions · high confidence

Migrate to XML-based .slnx solution format

The project has replaced the legacy .sln solution file with the new XML-based .slnx format (DispatchR.slnx). This change updates the solution structure to include the core DispatchR and Abstractions projects, the Sample and Benchmark applications, the AspireModularExample, and the test projects, while also organizing solution-level items like .gitignore and CHANGELOG.md.

(repo-wide) · high confidence

Behavioural changes

Add specific exception types for handler configuration validation

The library now includes dedicated exception classes to provide clearer error messages when handler configurations are invalid. Specifically, \HandlerNotFoundException\ is thrown when a request handler is missing from the DI container, detailing the request and response types involved. Additionally, \ExcludeHandlersCannotBeArrayEmptyException\ and \IncludeHandlersCannotBeArrayEmptyException\ are introduced to prevent configuration errors where exclude or include handler lists are incorrectly set to empty arrays.

src/DispatchR/Exceptions · high confidence

Handler filtering and pipeline ordering via ConfigurationOptions

Users can now explicitly control which handlers are registered and the order in which pipeline behaviors are applied. The new ConfigurationOptions class exposes IncludeHandlers and ExcludeHandlers lists to filter specific handler types, and a PipelineOrder list to define the execution sequence of pipelines. The ServiceRegistrator uses these options to skip excluded handlers, sort pipelines according to the specified order, and apply the resulting chain during service registration.

src/DispatchR/Configuration · high confidence

Mediator refactored to support non-generic notifications and remove pipeline execution

The Mediator implementation has been significantly restructured: it now supports publishing non-generic notifications via a new \Publish(object)\ method (marked obsolete due to performance concerns) alongside the existing generic \Publish\<TNotification\>\, while the previous generic request pipeline execution logic has been removed in favor of direct handler invocation. Additionally, the \IMediator\ interface and related abstractions (like \IRequest\, \IRequestPipeline\, and \IRequestHandler\) have been moved to the \DispatchR.Abstractions\ package, and the \DispatchRServiceCollection\ helper for automatic handler registration has been deleted, requiring users to manage service registration manually or via the abstractions package.

src/DispatchR · high confidence

Test coverage

Added integration tests for notification, request, and stream handling; Added unit tests for DispatchR configuration and handler execution; Expanded test fixtures for notification and request handling scenarios.

Dependencies

Upgrade to .NET 10 and split library into abstractions package

The DispatchR library now targets .NET 8, 9, and 10, with sample projects and benchmarks updated to .NET 10. The package has been split into two parts: the main implementation (DispatchR.Mediator) and a new abstractions package (DispatchR.Mediator.Abstractions), allowing consumers to reference only the interfaces they need. Centralized package version management is now enabled via Directory.Packages.props, and dependencies like Microsoft.Extensions.DependencyInjection.Abstractions are now version-managed centrally.

(dependencies) · high confidence

Housekeeping

Added large placeholder text file to sample project

A new file named BigFile.txt containing repeated Lorem Ipsum text has been added to the src/Sample directory. This file appears to be a static asset or test fixture for the sample application and does not impact the functional behavior of the product.

src/Sample · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 48 → 50 (+2.0)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 71 → 60 (-10.8)
  • Architecture 94 → 94 (+0.0)
  • Maturity 66 → 65 (-1.2)
  • Readiness 48 → 53 (+4.3)
  • Security 33 → 38 (+4.8)
  • Event-Driven 100 → 100 (+0.0)
  • Performance 70 → 70 (+0.4)

Resolved (31)

  • BarePragmaDisable (src/Benchmark/StreamRequest/StreamDispatchRCommands.cs)
  • BarePragmaDisable (src/Benchmark/StreamRequest/StreamMediatRCommands.cs)
  • BarePragmaDisable (src/Benchmark/StreamRequest/StreamMediatSGCommands.cs)
  • Bounded contexts not declared
  • High CVE: MessagePack 2.5.192
  • High CVE: MessagePack 2.5.192
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Hotspot: src/DispatchR/Configuration/ServiceRegistrator.cs (src/DispatchR/Configuration/ServiceRegistrator.cs)
  • Inconsistent casing in suffix 'MediatR' vs 'MediatSg'. 'MediatR' is used in one place, while 'MediatSg' (likely a typo or inconsistent abbreviation) is used in another.
  • Inconsistent casing in suffix 'MediatR' vs 'MediatSg'. 'MediatR' is used in one place, while 'MediatSg' is used in another.
  • Inconsistent suffix for MediatR vs DispatchR implementations. 'MediatR' is used for some types, while 'MediatSG' (likely a typo or inconsistent abbreviation for MediatR) is used for others.
  • Inconsistent suffix for MediatR vs DispatchR implementations. 'MediatR' is used for some types, while 'MediatSG' is used for others.
  • Medium CVE: MessagePack 2.5.192
  • Medium CVE: MessagePack 2.5.192
  • Medium CVE: MessagePack 2.5.192
  • Medium CVE: MessagePack 2.5.192
  • Medium CVE: MessagePack 2.5.192
  • Medium CVE: MessagePack 2.5.192
  • …and 11 more

New (25)

  • CoverageExclusion (src/DispatchR.Abstractions/Send/IRequestHandler.cs)
  • Documentation: no installation or build instructions (README.md)
  • FileScopedPragmaDisable (src/Benchmark/StreamRequest/StreamDispatchRCommands.cs)
  • FileScopedPragmaDisable (src/Benchmark/StreamRequest/StreamMediatRCommands.cs)
  • FileScopedPragmaDisable (src/Benchmark/StreamRequest/StreamMediatSGCommands.cs)
  • High CVE: MessagePack 2.5.192
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Inconsistent casing in the suffix 'MediatSg' vs 'MediatSG'. While style, this inconsistency is compounded by the previous finding regarding 'MediatR' vs 'MediatSG'. The casing difference suggests a lack of strict naming convention enforcement for this specific abbreviation.
  • No assertions: Send_UsesPipelineBehaviors_RequestWithOutResponseWithPipelines (tests/DispatchR.UnitTest/RequestHandlerTests.cs)
  • No dependency advisory monitoring
  • No test project references AspireModularSample.AppHost (src/AspireModularExample/AspireModularSample.AppHost/AspireModularSample.AppHost.csproj)
  • No test project references AspireModularSample.Modules (src/AspireModularExample/AspireModularSample.Modules/AspireModularSample.Modules.csproj)
  • No test project references AspireModularSample.ServiceA (src/AspireModularExample/AspireModularSample.ServiceA/AspireModularSample.ServiceA.csproj)
  • No test project references AspireModularSample.ServiceB (src/AspireModularExample/AspireModularSample.ServiceB/AspireModularSample.ServiceB.csproj)
  • Outdated: xunit.runner.visualstudio
  • …and 5 more

Changes since last survey

  • 1 commits — 0 feature/other, 1 fixes

By area

  • (root) — 1 commit

Notable commits

  • fix: Fix broken star history chart in README (#56)

API surface

  • Unchanged — 10 HTTP endpoints

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

hasanxdev/DispatchR was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 69be51282eda4bb72a600321c0585b280a1f8786 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.