i26.Hosting
0.5.0
dotnet add package i26.Hosting --version 0.5.0
NuGet\Install-Package i26.Hosting -Version 0.5.0
<PackageReference Include="i26.Hosting" Version="0.5.0" />
<PackageVersion Include="i26.Hosting" Version="0.5.0" />
<PackageReference Include="i26.Hosting" />
paket add i26.Hosting --version 0.5.0
#r "nuget: i26.Hosting, 0.5.0"
#:package i26.Hosting@0.5.0
#addin nuget:?package=i26.Hosting&version=0.5.0
#tool nuget:?package=i26.Hosting&version=0.5.0
i26.Hosting
Domain events handled off the request, with no Redis, no table and no broker.
dotnet add package i26.Hosting
Running the handlers in process runs them in the request: the caller waits for them, and one that throws surfaces out of whatever published. This is the same handlers, behind an in-memory queue read by a hosted service.
services.AddHandlers(typeof(DependencyInjection).Assembly);
services.AddBackgroundDomainEvents();
That is the whole setup. Publishing writes to the queue and returns; the hosted service runs the handlers one event at a time.
The part worth knowing
Each event gets a scope of its own, because the scope that raised it ended with the request. That scope has its own database context and no user or tenant resolved in it — whatever a handler needs to know about who did what, the event has to carry. It is also the decision that survives the day this becomes a broker: on the other side of a queue there is no scope left to restore.
The queue is in memory. Stopping the host stops accepting events and hands over what is already
queued, within whatever ShutdownTimeout allows, but what it holds when the process dies is lost.
Fine for a notification or a projection refresh; not for something that has to happen. When it has
to, IDomainEventDispatcher is still the seam and an outbox goes behind it.
Capacity |
How many events may be waiting. Publishing waits while the queue is full, rather than dropping. Default 1024, null for no limit. |
Concurrency |
How many are handled at once. Default 1, which keeps them in the order they were raised. |
A handler that throws is logged and the queue keeps moving.
What it drags in
Microsoft.Extensions.Hosting.Abstractions and Microsoft.Extensions.Logging.Abstractions, plus
i26.Core and i26.Cqrs.
Documentation
Domain events in the repository README, and handling them in the background.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 is compatible. 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 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
- i26.Core (>= 0.5.0)
- i26.Cqrs (>= 0.5.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.4)
-
net8.0
- i26.Core (>= 0.5.0)
- i26.Cqrs (>= 0.5.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
-
net9.0
- i26.Core (>= 0.5.0)
- i26.Cqrs (>= 0.5.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.