DisruptorCS.Extensions.Hosting
0.10.0
dotnet add package DisruptorCS.Extensions.Hosting --version 0.10.0
NuGet\Install-Package DisruptorCS.Extensions.Hosting -Version 0.10.0
<PackageReference Include="DisruptorCS.Extensions.Hosting" Version="0.10.0" />
<PackageVersion Include="DisruptorCS.Extensions.Hosting" Version="0.10.0" />
<PackageReference Include="DisruptorCS.Extensions.Hosting" />
paket add DisruptorCS.Extensions.Hosting --version 0.10.0
#r "nuget: DisruptorCS.Extensions.Hosting, 0.10.0"
#:package DisruptorCS.Extensions.Hosting@0.10.0
#addin nuget:?package=DisruptorCS.Extensions.Hosting&version=0.10.0
#tool nuget:?package=DisruptorCS.Extensions.Hosting&version=0.10.0
DisruptorCS.Extensions.Hosting
Microsoft.Extensions integration for DisruptorCS:
DI registration, Generic Host lifecycle binding, and health checks.
dotnet add package DisruptorCS.Extensions.Hosting
Targets net8.0 and net10.0. AOT-compatible. MIT licensed.
Registration
builder.Services.AddDisruptor<GameCommand>(d => d
.WithEventFactory(() => new GameCommand())
.WithRingSize(65536)
.WithProducerType(ProducerType.Multi)
.HandleEventsWith<JournalHandler>() // handlers are resolved from DI
.Then<GameLogicHandler>()
.ThenWorkerPool<DbWriteWorker>(workers: 4));
Handlers are constructed by the container, so they can take loggers, options, and repositories the same way any other service does.
AddDisruptor and AddDisruptorCheck live in Microsoft.Extensions.DependencyInjection, so a
typical Program.cs needs no extra using — they show up on builder.Services directly.
Lifecycle
AddDisruptor<T> registers an IHostedService, so the pipeline starts with the host and shuts down
with it — draining events that are already in the ring before the process exits. No manual
Start() / Shutdown() call, and no events lost on a graceful stop.
Health checks
builder.Services.AddHealthChecks().AddDisruptorCheck<GameCommand>();
The check reports Degraded at 70% ring utilization and Unhealthy at 90% — a consumer that cannot keep up shows up before the producers actually block. A halted processor is reported as Unhealthy regardless of utilization, with the halted processor names in the result data.
Separately, DisruptorHostedService<T> logs a halt at Critical and, by default
(ProcessorHaltPolicy.StopApplication), triggers a graceful application stop: a halted processor
keeps its sequence in the gating set, so the producers are about to block forever. A pod that
restarts beats an unresponsive zombie. Set ProcessorHaltPolicy.LogOnly if you handle recovery
yourself.
Types
| Type | Purpose |
|---|---|
DisruptorServiceCollectionExtensions.AddDisruptor<T> |
Registers the ring buffer, the pipeline, and the hosted service |
DisruptorBuilder<T> |
Fluent pipeline configuration with DI-resolved handlers |
DisruptorHostedService<T> |
Binds start/drain/shutdown to the host lifecycle |
DisruptorHealthCheck<T> |
IHealthCheck over utilization and processor state |
ProcessorHaltPolicy |
What the host does when a processor halts (StopApplication by default) |
Links
- README · 한국어 README
- AspNetCoreTelemetry sample — DI, health checks, and live metrics end to end
- CHANGELOG
- Issues
| 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 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 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
- DisruptorCS (>= 0.10.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
-
net8.0
- DisruptorCS (>= 0.10.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
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 |
|---|---|---|
| 0.10.0 | 102 | 8/27/2026 |