TinyDispatcher 1.1.0
See the version list below for details.
dotnet add package TinyDispatcher --version 1.1.0
NuGet\Install-Package TinyDispatcher -Version 1.1.0
<PackageReference Include="TinyDispatcher" Version="1.1.0" />
<PackageVersion Include="TinyDispatcher" Version="1.1.0" />
<PackageReference Include="TinyDispatcher" />
paket add TinyDispatcher --version 1.1.0
#r "nuget: TinyDispatcher, 1.1.0"
#:package TinyDispatcher@1.1.0
#addin nuget:?package=TinyDispatcher&version=1.1.0
#tool nuget:?package=TinyDispatcher&version=1.1.0
TinyDispatcher
TinyDispatcher is a small, compile-time oriented dispatcher for .NET.
It provides a predictable, explicit, and performant command/query dispatch core by moving:
- handler discovery to build time
- middleware pipeline composition to generated code (also build time)
...while keeping runtime execution simple and scope-friendly.
What you get
- Compile-time handler discovery (no runtime scanning/reflection)
- Generated pipelines (global middleware → policy middleware → per-command middleware → handler)
- Deterministic ordering and precedence rules (predictable output)
- Explicit context (
TContext) for command handlers - Multi-assembly composition with host-owned final pipeline generation
- Pluggable context factory (pass a delegate or register
IContextFactory<TContext>) - Feature-friendly
AppContext(optionalIFeatureInitializer-based composition) - Source-generator diagnostics for invalid shapes/config (fail fast, no guessing)
Install
dotnet add package TinyDispatcher
Quick start
Define a command:
public sealed record CreateOrder(string OrderId) : ICommand;
Define a context-aware handler:
public sealed class CreateOrderHandler : ICommandHandler<CreateOrder, AppContext>
{
public Task HandleAsync(CreateOrder command, AppContext ctx, CancellationToken ct = default)
=> Task.CompletedTask;
}
Register:
services.UseTinyDispatcher<AppContext>(tiny =>
{
// optional: middleware, policies, features
});
Dispatch:
await dispatcher.DispatchAsync(new CreateOrder("123"), ct);
Multi-assembly composition
TinyDispatcher supports a modular setup where:
- handlers can live in referenced class libraries
- middleware and policies can also live outside the host assembly
- contributing assemblies publish structured compile-time metadata
- the host remains the sole final composer of pipelines
This keeps the runtime simple while letting the generator build final pipelines for the full command universe visible to the host.
Documentation
- Getting Started
- Architecture
- Multi-Assembly Composition
- Middleware
- Pipelines & Layering
- Context & Features
- Source Generator
- Pipeline Maps
- Performance Notes
- Migration Guide
- Design Decisions
- Benchmarks
When to use
TinyDispatcher is a good fit when you want:
- explicit execution flow you can read and debug
- deterministic middleware precedence
- compile-time discovery (no runtime scanning)
- a small, focused dispatch core rather than a full framework
- aot friendly.
- microservices, minimal Api and Azure functions.
Test Coverage & Hardening
TinyDispatcher includes a comprehensive automated test suite covering both the runtime dispatcher and the Roslyn source generator.
Current coverage (March 2026):
| Component | Line Coverage | Branch Coverage |
|---|---|---|
| Overall | ~89% | ~76% |
Runtime (TinyDispatcher) |
~84% | ~68% |
Source Generator (TinyDispatcher.SourceGen) |
~90% | ~77% |
Critical runtime infrastructure is fully covered, including:
AppContextFeatureCollectionDefaultAppContextFactoryServiceCollectionExtensionsTinyBootstrapPipelineContributionStore
These components form the core execution and configuration model of TinyDispatcher.
Hardening Sessions
Leading up after the first stable release, the project is undergoing a short series of hardening sessions focused on strengthening runtime guarantees and improving branch coverage.
These sessions concentrate on:
- improving branch coverage for the dispatcher execution paths
- validating middleware and policy registration behavior
- verifying cancellation propagation through the dispatcher pipeline
- testing error scenarios and diagnostics generated by the source generator
- increasing coverage for generator validation paths
All tests focus on observable behavior rather than internal implementation details, ensuring the dispatcher can evolve safely without breaking public guarantees.
The goal is to keep TinyDispatcher:
- predictable
- explicit
- well-tested
- safe to evolve
Samples
The repository contains runnable samples under samples/, including:
- ASP.NET and custom context setups
- context factory and closed-context middleware examples
- a multi-project sample showing cross-assembly handler and pipeline composition
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0-alpha.1 | 53 | 5/18/2026 |
| 1.1.0 | 128 | 5/18/2026 |
| 1.1.0-rc3 | 98 | 5/8/2026 |
| 1.1.0-rc2 | 87 | 4/30/2026 |
| 1.1.0-rc1 | 98 | 4/23/2026 |
| 1.0.4 | 113 | 2/27/2026 |
| 1.0.3 | 110 | 2/26/2026 |
| 1.0.2 | 114 | 2/24/2026 |
| 1.0.0 | 109 | 2/22/2026 |
| 0.1.103-alpha-g6d84474285 | 103 | 2/18/2026 |
| 0.1.95-alpha-g1af6552045 | 97 | 2/17/2026 |
| 0.1.92-alpha-g79c3d573d0 | 107 | 2/17/2026 |
| 0.1.75-alpha-gedad2aaa3d | 105 | 2/14/2026 |
| 0.1.74-alpha-g62dc7240c6 | 102 | 2/14/2026 |
| 0.1.72-alpha-g7b6aee462b | 104 | 2/14/2026 |
| 0.1.62-alpha-gee4b863caa | 101 | 2/13/2026 |
| 0.1.58-alpha-g074b6009d7 | 102 | 2/11/2026 |
| 0.1.53-alpha-g68bf9bd71f | 127 | 2/9/2026 |
| 0.1.28-alpha-g81295fddf9 | 112 | 2/5/2026 |
| 0.1.21-alpha-ge2922c0023 | 111 | 2/4/2026 |
TinyDispatcher 1.1.0
Added
- Multi-assembly composition support with structured assembly contributions.
- Host-side pipeline generation for commands contributed by referenced assemblies.
- Assembly-level contribution attributes for compile-time cross-assembly composition.
Changed
- Generated ModuleInitializers now publish ThisAssemblyContribution.Create().
- DispatcherPipelineBootstrap stores structured contribution snapshots while preserving DI application behavior.
- Source generator validation now reports referenced assembly conflicts with clearer provenance.
Fixed
- Referenced assemblies can now contribute global middleware to host-generated pipelines.
- Non-host projects skip redundant referenced contribution validation.