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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DisruptorCS.Extensions.Hosting" Version="0.10.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DisruptorCS.Extensions.Hosting" Version="0.10.0" />
                    
Directory.Packages.props
<PackageReference Include="DisruptorCS.Extensions.Hosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DisruptorCS.Extensions.Hosting --version 0.10.0
                    
#r "nuget: DisruptorCS.Extensions.Hosting, 0.10.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DisruptorCS.Extensions.Hosting@0.10.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DisruptorCS.Extensions.Hosting&version=0.10.0
                    
Install as a Cake Addin
#tool nuget:?package=DisruptorCS.Extensions.Hosting&version=0.10.0
                    
Install as a Cake Tool

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)
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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