Bsft.Hosting.BackgroundWork
2.2.0
dotnet add package Bsft.Hosting.BackgroundWork --version 2.2.0
NuGet\Install-Package Bsft.Hosting.BackgroundWork -Version 2.2.0
<PackageReference Include="Bsft.Hosting.BackgroundWork" Version="2.2.0" />
<PackageVersion Include="Bsft.Hosting.BackgroundWork" Version="2.2.0" />
<PackageReference Include="Bsft.Hosting.BackgroundWork" />
paket add Bsft.Hosting.BackgroundWork --version 2.2.0
#r "nuget: Bsft.Hosting.BackgroundWork, 2.2.0"
#:package Bsft.Hosting.BackgroundWork@2.2.0
#addin nuget:?package=Bsft.Hosting.BackgroundWork&version=2.2.0
#tool nuget:?package=Bsft.Hosting.BackgroundWork&version=2.2.0
Bsft.Hosting.BackgroundWork
Background work for a generic host, without the web stack: a startup operation that keeps trying until it
succeeds, and bounded, never-blocking pipelines that hand items from a hot path to a batching writer. It is
what a console tool or a CLI takes when it wants the pipelines and nothing else. Bsft.Hosting references it,
so a web host gets the same types from either package.
Install
dotnet add package Bsft.Hosting.BackgroundWork
Depends on Bsft.Instrumentation and on Microsoft.Extensions.Hosting (the generic host, for HostOptions),
Microsoft.Extensions.Options, Microsoft.Extensions.Logging.Abstractions,
Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.Configuration.Binder. It has
no FrameworkReference on Microsoft.AspNetCore.App and no Swashbuckle, Asp.Versioning or OpenAPI package;
a test pins that closure.
Register
using Bsft.Hosting.BackgroundWork.DependencyInjection;
services.AddBsftBackgroundWorkRunOnce<RegisterInstanceService>(configuration);
services.AddBsftBatchingWriter<UsageRecord, UsageBatchCommitter>(configuration)
.AddBsftPipelineEnrichment<UsageRecord, UsageEnricher>(); // optional, after the writer
// producers inject IBoundedBuffer<UsageRecord> (or IEnrichmentStage<UsageRecord>) and call TryEnqueue
The types keep the namespaces they had in Bsft.Hosting (Bsft.Hosting.BackgroundWork,
Bsft.Hosting.BackgroundWork.Pipelines). Only the two registration classes moved to
Bsft.Hosting.BackgroundWork.DependencyInjection, which is where the package conventions put a package's
entry points; a host that used using Bsft.Hosting.DependencyInjection; for these calls adds that one using.
Configure
| Option | Default | Effect |
|---|---|---|
BsftRunOnceOptions (Bsft:Hosting:RunOnce:<service type full name>) |
see hosting.md | The backoff of a run-once startup operation. |
BsftBoundedPipelineOptions (Bsft:Hosting:Pipelines:<item type full name>) |
see hosting.md | Capacity, batch size, flush interval and the stop budgets of a pipeline. |
Both validate on start; the pipeline's stop budgets must fit in HostOptions.ShutdownTimeout. Counters are read
through IPipelineCounters<TItem> and emitted as bsft.pipeline.items on the instrumentation source
BackgroundWorkDefaults.PipelineInstrumentationSourceName (Bsft.Hosting, the name they always had).
Extend
IBatchCommitter<TItem> is what a host implements to store a batch; IPipelineEnricher<TItem> is the optional
per-item enrichment. RunOnceWithRetryBackgroundServiceBase is the base class of a run-once operation, and
IServiceScopeFactory.RunScopedAsync runs one operation against a scoped service and disposes the scope on every
path.
Documentation
Topic page: docs/hosting.md. Conventions: docs/package-conventions.md.
| 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
- Bsft.Instrumentation (>= 2.2.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
-
net8.0
- Bsft.Instrumentation (>= 2.2.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.19)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.19)
- Microsoft.Extensions.Hosting (>= 9.0.19)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.19)
- Microsoft.Extensions.Options (>= 9.0.19)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bsft.Hosting.BackgroundWork:
| Package | Downloads |
|---|---|
|
Bsft.Hosting
BSFT Framework hosting defaults, health checks, and startup validation |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.0 | 173 | 10/23/2026 |