Anarchy.Toolkit.Hosting.Workers
2.0.0
See the version list below for details.
dotnet add package Anarchy.Toolkit.Hosting.Workers --version 2.0.0
NuGet\Install-Package Anarchy.Toolkit.Hosting.Workers -Version 2.0.0
<PackageReference Include="Anarchy.Toolkit.Hosting.Workers" Version="2.0.0" />
<PackageVersion Include="Anarchy.Toolkit.Hosting.Workers" Version="2.0.0" />
<PackageReference Include="Anarchy.Toolkit.Hosting.Workers" />
paket add Anarchy.Toolkit.Hosting.Workers --version 2.0.0
#r "nuget: Anarchy.Toolkit.Hosting.Workers, 2.0.0"
#:package Anarchy.Toolkit.Hosting.Workers@2.0.0
#addin nuget:?package=Anarchy.Toolkit.Hosting.Workers&version=2.0.0
#tool nuget:?package=Anarchy.Toolkit.Hosting.Workers&version=2.0.0
Anarchy.Toolkit.Hosting.Workers
Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Hosting · Package catalog
Background-worker primitives and a self-hosted health API for worker processes.
dotnet add package Anarchy.Toolkit.Hosting.Workers
- Derive from
WorkerBase,MonitoredWorkerBaseorResilientWorkerBase;HeartbeatWorkerprovides a heartbeat. ResilientWorkerBasegives every iteration a new correlation id and every attempt a new attempt id, throughCorrelationContext.BeginScope: they reach every logging provider as scope properties and the current activity as tags. Work that carries its own ids (a consumed message) opensBeginCorrelationScope(correlationId, attemptId)around its processing.- Register the health worker with
AddServiceHealthCheckWorker(assembly)to serve/health/instance,/health/servicesand/health/status. - Supply an
IReadOnlyCollection<IHealthCheck>for service checks; the services endpoint returns HTTP 500 when a check fails.
When to use it
Choose this package for a long-running process that needs hosted workers, operational heartbeat or HTTP health endpoints without building a full REST API. It complements Hosting, which provides the application host and entry-point conventions.
How to use it
- Implement a worker using the base that matches the required monitoring or resilience behavior, and register it with the host's
IServiceCollectionas a hosted service. Instrumented workers take the registeredAppTelemetry(seeModuleTelemetryorAddCoreTelemetry()). - If health endpoints are required, call
services.AddServiceHealthCheckWorker(typeof(YourWorker).Assembly)from startup. Register settings implementingIWorkerHealthCheckAppSettings, including the health service port, and make the listener reachable only as appropriate for your deployment. - Supply the
IReadOnlyCollection<IHealthCheck>used by the endpoint, or use a provider's health-report registration. Without reports, the package installs an empty collection. Embed build metadata in the supplied assembly if it should appear in status output.
The sample worker startup demonstrates registering a heartbeat and a custom hosted worker.
See the worker sample and toolkit overview.
Releases
2.0.0
- feat(automation): establish onboarding and layering conventions
- feat(telemetry)!: introduce provider-neutral application telemetry
- refactor(packages)!: restructure persistence and automation packages
- refactor(infrastructure.correlationid)!: decouple correlation scopes from Serilog
- refactor(core)!: reshape telemetry, event and health contracts
- refactor(telemetry)!: remove legacy APIs and simplify namespaces
- refactor(telemetry)!: update consumers and samples
1.2.0
- fix(Hosting.Workers): let the health API listen on a port the OS chooses
1.1.1
- docs(packages): identify each package's pillar and layer
- build(packages): attribute the copyright to Leandro Melão Medeiros
- build: relicense under Apache-2.0 and update the package metadata
1.1.0
- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1
1.0.7
- docs: expand XML docblocks across all projects for the DocFX API reference
1.0.6
- refactor(src): clean up code style across library packages
- chore(deps): update AWS SDK, Lambda ASP.NET Core server and MySqlConnector packages
1.0.5
- chore(deps): update AWS SDK packages
1.0.3
- build: migrate local automation to build tooling
1.0.2
- docs: expand package guides and release histories
- chore(deps): update AWS, Polly, and xUnit packages
1.0.1
- Added a package-specific NuGet README.
1.0.0
- Introduced monitored and resilient worker bases, heartbeat and health checks, a self-hosted health API and build metadata readers.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Amazon.Extensions.Configuration.SystemsManager (>= 7.1.1)
- Anarchy.Toolkit.Configuration (>= 2.0.0)
- Anarchy.Toolkit.Core (>= 2.0.0)
- Anarchy.Toolkit.Core.Health (>= 2.0.0)
- Anarchy.Toolkit.Core.Telemetry (>= 1.0.0)
- Anarchy.Toolkit.Infrastructure.CorrelationId (>= 2.0.0)
- AWSSDK.Core (>= 4.1.1.2)
- AWSSDK.KeyManagementService (>= 4.1.1.1)
- AWSSDK.SecretsManager (>= 4.1.1.2)
- Humanizer (>= 3.0.10)
- Microsoft.Extensions.Hosting.Systemd (>= 10.0.15)
- Microsoft.Identity.Client (>= 4.92.0)
- Newtonsoft.Json (>= 13.0.4)
- Polly.Core (>= 8.9.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.