SimpleW.Service.Background 26.0.0-alpha.20260428-1831

This is a prerelease version of SimpleW.Service.Background.
dotnet add package SimpleW.Service.Background --version 26.0.0-alpha.20260428-1831
                    
NuGet\Install-Package SimpleW.Service.Background -Version 26.0.0-alpha.20260428-1831
                    
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="SimpleW.Service.Background" Version="26.0.0-alpha.20260428-1831" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleW.Service.Background" Version="26.0.0-alpha.20260428-1831" />
                    
Directory.Packages.props
<PackageReference Include="SimpleW.Service.Background" />
                    
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 SimpleW.Service.Background --version 26.0.0-alpha.20260428-1831
                    
#r "nuget: SimpleW.Service.Background, 26.0.0-alpha.20260428-1831"
                    
#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 SimpleW.Service.Background@26.0.0-alpha.20260428-1831
                    
#: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=SimpleW.Service.Background&version=26.0.0-alpha.20260428-1831&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SimpleW.Service.Background&version=26.0.0-alpha.20260428-1831&prerelease
                    
Install as a Cake Tool

SimpleW.Service.Background

website

In-process background jobs and cron scheduling for SimpleW.

Getting Started

using SimpleW;
using SimpleW.Service.Background;

var server = new SimpleWServer(System.Net.IPAddress.Any, 8080);

server.UseBackgroundModule(options => {
    options.WorkerCount = 2;
    options.JobStore = new MemoryBackgroundJobStore();

    options.Schedule("cleanup", "0 2 * * *", async ctx => {
        await CleanupAsync(ctx.CancellationToken);
    });
});

server.MapPost("/import", (HttpSession session) => {
    string payload = session.Request.BodyString;

    BackgroundJobHandle job = session.GetBackgroundService().Enqueue("import", async ctx => {
        ctx.ReportProgress(0, "Starting import");
        await ImportAsync(payload, ctx.CancellationToken);
        ctx.ReportProgress(100, "Done");
    });

    return session.Response.Status(202).Json(new {
        accepted = true,
        jobId = job.Id
    });
});

await server.RunAsync();

Jobs are kept in memory only. They do not survive process restart.

Use ctx.ReportProgress(percent, message) from inside a job to update the latest progress exposed by GetJob(jobId).

Telemetry is optional and follows the SimpleW telemetry switch:

server.EnableTelemetry();

server.UseBackgroundModule(options => {
    options.EnableTelemetry = true;
});

When enabled, the module emits low-cardinality counters and gauges such as simplew.background.job.enqueued.count, simplew.background.job.completed.count, simplew.background.queue.length, and simplew.background.job.running.

Metrics are tagged only with stable values like source, result, and reason. Job ids, job names, cron expressions, and progress messages are not used as metric tags.

Use options.JobStore with a custom IBackgroundJobStore to persist job snapshots in another backend. The current module still executes in-process delegates; durable replay after restart will need a future typed-job/payload model.

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 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. 
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
26.0.0-alpha.20260428-1831 51 4/28/2026
26.0.0-alpha.20260427-1828 56 4/27/2026