UnambitiousFx.Synapse.Abstractions
1.0.0-beta6
See the version list below for details.
dotnet add package UnambitiousFx.Synapse.Abstractions --version 1.0.0-beta6
NuGet\Install-Package UnambitiousFx.Synapse.Abstractions -Version 1.0.0-beta6
<PackageReference Include="UnambitiousFx.Synapse.Abstractions" Version="1.0.0-beta6" />
<PackageVersion Include="UnambitiousFx.Synapse.Abstractions" Version="1.0.0-beta6" />
<PackageReference Include="UnambitiousFx.Synapse.Abstractions" />
paket add UnambitiousFx.Synapse.Abstractions --version 1.0.0-beta6
#r "nuget: UnambitiousFx.Synapse.Abstractions, 1.0.0-beta6"
#:package UnambitiousFx.Synapse.Abstractions@1.0.0-beta6
#addin nuget:?package=UnambitiousFx.Synapse.Abstractions&version=1.0.0-beta6&prerelease
#tool nuget:?package=UnambitiousFx.Synapse.Abstractions&version=1.0.0-beta6&prerelease
Synapse
A lightweight, high-performance mediator implementation for .NET with first-class integration with Result types.
๐ง Compatibility & support
- Dependency-free at runtime: No external runtime dependencies.
- Native AOT-compatible: Designed to work well in Native AOT scenarios (see the
examples/WebApiAot). - Supported .NET versions: Supports Microsoft LTS releases and the latest non-LTS release. See CI matrix for exact versions.
๐ฏ Features
- Lightweight Mediator โ Requests, commands, queries, and notifications with minimal allocations.
- Result-first โ Uses
UnambitiousFx.FunctionalResultfor explicit error handling. - Streaming requests โ Built-in support for streaming request/response patterns.
- Pipeline Behaviors โ Typed, untyped and conditional pipeline behaviors for requests and events.
- Dependency injection friendly โ Register handlers and behaviours via a fluent configuration API (
AddSynapse). - Outbox support โ Interfaces and helpers to implement the outbox pattern and reliable event publishing.
- Observability hooks โ Metrics and tracing integration points to capture latency and publish metrics.
- Source generator โ Optional code-generation to reduce allocations and simplify registration.
- Examples & benchmarks โ Real-world examples and performance benchmarks included.
๐ฆ Installation
dotnet add package UnambitiousFx.Synapse
๐ Quick Start
Register mediator services
Register the synapse and your handlers in Program.cs:
builder.Services.AddSynapse(cfg =>
{
cfg.AddRegisterGroup(new ManualRegisterGroup());
// Request handlers
cfg.RegisterRequestHandler<CreateTodoCommandHandler, CreateTodoCommand, Guid>()
.RegisterRequestHandler<ListTodoQueryHandler, ListTodoQuery, IEnumerable<Todo>>();
// Event handlers
cfg.RegisterEventHandler<TodoUpdatedHandler, TodoUpdated>();
// Pipeline behaviors
cfg.RegisterRequestPipelineBehavior<SimpleLoggingBehavior>();
cfg.RegisterEventPipelineBehavior<SimpleLoggingBehavior>();
});
Send requests
Use ISender to dispatch requests to handlers:
// Send a command that returns a value
var result = await sender.SendAsync<CreateTodoCommand, Guid>(command);
// Send a command without a response
var result = await sender.SendAsync<UpdateTodoCommand>(command);
// Stream results from an IStreamRequest
await foreach (var itemResult in sender.SendStreamAsync<ListItemsRequest, Item>(request))
{
// itemResult is Result<Item>
}
Use handlers directly
You can also resolve IRequestHandler<TRequest, TResponse> or IRequestHandler<TRequest> from DI and call
HandleAsync directly when appropriate.
๐ Observability & Metrics
Synapse exposes hooks for recording metrics and integrates with OpenTelemetry tracing through dedicated activity sources
and metric interfaces. Consumers can provide their own ISynapseMetrics implementation or use the default which
integrates with IMeterFactory.
๐งช Examples & Benchmarks
- Examples are under the
examples/folder (Web API, Console, Native AOT example). - Benchmarks are available in
benchmarks/SynapseBenchmarkto measure throughput and compare against alternatives.
๐งฉ Extensibility
- Pipeline behaviors: implement
IRequestPipelineBehavior,IEventPipelineBehavior, or the typed/stream variants. - Registration groups: implement
IRegisterGroupto modularize and share handler registration logic. - Outbox & commits: implement
IOutboxStorage,IOutboxCommitfor transactional event persistence.
Note: Transport/distributed messaging APIs are intentionally not documented here โ they may change prior to the first stable release.
๐ค Contributing
We welcome contributions! Please read CONTRIBUTING.md for standards, development setup, and the PR process.
๐ Release notes
See releases on GitHub for detailed changelogs and version history: https://github.com/UnambitiousFx/Synapse/releases
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ by the UnambitiousFx team
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- UnambitiousFx.Functional (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on UnambitiousFx.Synapse.Abstractions:
| Package | Downloads |
|---|---|
|
UnambitiousFx.Synapse
A lightweight, performance-oriented library for building message-driven applications and in-process mediators. Provides composable primitives for Commands, Queries, Events, and Pipelines with a focus on low latency and minimal allocations. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 122 | 5/3/2026 |
| 1.0.0-beta6 | 136 | 2/5/2026 |
| 1.0.0-beta5 | 110 | 2/5/2026 |
| 1.0.0-beta4 | 111 | 2/4/2026 |
| 1.0.0-beta3 | 124 | 1/8/2026 |
| 1.0.0-beta2 | 117 | 1/6/2026 |
| 1.0.0-beta1 | 116 | 1/6/2026 |