Slipstream 0.0.5
dotnet add package Slipstream --version 0.0.5
NuGet\Install-Package Slipstream -Version 0.0.5
<PackageReference Include="Slipstream" Version="0.0.5" />
<PackageVersion Include="Slipstream" Version="0.0.5" />
<PackageReference Include="Slipstream" />
paket add Slipstream --version 0.0.5
#r "nuget: Slipstream, 0.0.5"
#:package Slipstream@0.0.5
#addin nuget:?package=Slipstream&version=0.0.5
#tool nuget:?package=Slipstream&version=0.0.5
Slipstream
Fast, lean CQRS dispatcher with pipeline behaviors.
Slipstream is a lightweight alternative to MediatR focused on doing one thing well — dispatching requests through a pipeline to a single handler. No event publishing, no bloat, just clean request/response dispatching.
Features
- Request/response dispatching via
IDispatcher - Void request support (fire-and-forget style)
- Pipeline behaviors for cross-cutting concerns (logging, validation, transactions, etc.)
- Reflection-free hot path via cached generic wrappers
- No dependencies beyond
Microsoft.Extensions.DependencyInjection.Abstractions
Installation
dotnet add package Slipstream
Quick Start
1. Define a request
// With a response
public record GetOrderById(int Id) : IRequest<Order>;
// Without a response
public record DeleteOrder(int Id) : IRequest;
2. Implement a handler
public class GetOrderByIdHandler : IRequestHandler<GetOrderById, Order>
{
public Task<Order> Handle(GetOrderById request, CancellationToken cancellationToken)
{
// your logic here
return Task.FromResult(new Order(request.Id));
}
}
public class DeleteOrderHandler : IRequestHandler<DeleteOrder>
{
public Task Handle(DeleteOrder request, CancellationToken cancellationToken)
{
// your logic here
return Task.CompletedTask;
}
}
3. Register with your DI container
// Scans the assembly and registers all handlers and the dispatcher
builder.Services.AddSlipstream(typeof(GetOrderByIdHandler).Assembly);
// Register behaviors manually in the order you want them to execute
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
Note: Behaviors are intentionally left to the consumer to register. Order matters — behaviors execute in registration order, so explicit control is by design.
4. Dispatch
public class OrdersController
{
private readonly IDispatcher _dispatcher;
public OrdersController(IDispatcher dispatcher)
{
_dispatcher = dispatcher;
}
public async Task<Order> Get(int id)
{
return await _dispatcher.Send(new GetOrderById(id));
}
}
Pipeline Behaviors
Behaviors wrap handler execution and are ideal for logging, validation, exception handling, and transactions.
public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
where TRequest : IRequest<TResponse>
{
private readonly ILogger<LoggingBehavior<TRequest, TResponse>> _logger;
public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger)
{
_logger = logger;
}
public async Task<TResponse> Handle(
TRequest request,
CancellationToken cancellationToken,
RequestHandlerDelegate<TResponse> next)
{
_logger.LogInformation("Handling {Request}", typeof(TRequest).Name);
var response = await next();
_logger.LogInformation("Handled {Request}", typeof(TRequest).Name);
return response;
}
}
Behaviors execute in registration order, wrapping the handler like an onion:
Behavior1 -> Behavior2 -> Handler -> Behavior2 -> Behavior1
Why Not MediatR?
MediatR is excellent but carries features many projects don't need — notifications, polymorphic dispatch, and a growing surface area. Slipstream is for teams that want the request/pipeline pattern without the overhead.
| Slipstream | MediatR | |
|---|---|---|
| Request/Response | ✅ | ✅ |
| Pipeline Behaviors | ✅ | ✅ |
| Notifications | ❌ intentional | ✅ |
| Reflection-free hot path | ✅ | ✅ (v12+) |
| Dependencies | Abstractions only | Abstractions only |
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.