Dloizides.Jobs.AspNetCore
1.1.3
dotnet add package Dloizides.Jobs.AspNetCore --version 1.1.3
NuGet\Install-Package Dloizides.Jobs.AspNetCore -Version 1.1.3
<PackageReference Include="Dloizides.Jobs.AspNetCore" Version="1.1.3" />
<PackageVersion Include="Dloizides.Jobs.AspNetCore" Version="1.1.3" />
<PackageReference Include="Dloizides.Jobs.AspNetCore" />
paket add Dloizides.Jobs.AspNetCore --version 1.1.3
#r "nuget: Dloizides.Jobs.AspNetCore, 1.1.3"
#:package Dloizides.Jobs.AspNetCore@1.1.3
#addin nuget:?package=Dloizides.Jobs.AspNetCore&version=1.1.3
#tool nuget:?package=Dloizides.Jobs.AspNetCore&version=1.1.3
Dloizides.Jobs.AspNetCore
The ASP.NET Core real-time wire for Dloizides.Jobs.
Background-job status is durable and pollable out of the box; this package adds opt-in PUSH to the
browser. MapJobStatusStream mounts an SSE and/or WebSocket endpoint that subscribes to the job
status backplane and streams authoritative JobStatus snapshots to connected clients.
It is a separate package on purpose: the core stays free of Microsoft.AspNetCore so a worker with no HTTP
surface can still run jobs. This package adds only a FrameworkReference to Microsoft.AspNetCore.App — SSE
and WebSocket are both built on framework primitives, no third-party dependency.
Persist first, push second
Push is never load-bearing. The backplane event is only a hint ("job X changed"); on each event the wire
re-reads the durable JobStatus via IJobStatusQuery and pushes that. So a push client and a poll client
render identical truth, and a dropped notification or a blipped socket is healed by the next poll or a
reconnect-then-snapshot (every connection sends an initial snapshot on open).
Wiring
// 1. A backplane in Dloizides.Jobs core / a transport package, selected by config:
builder.AddDloizidesJobs(jobs =>
{
jobs.AddJob<IngestJob>();
jobs.UseEntityFrameworkStore<AppDbContext>();
jobs.UsePostgresStatusBackplane<AppDbContext>(); // cross-pod fan-out (Dloizides.Jobs.EntityFrameworkCore)
});
// 2. Register the wires (both; config decides which mount):
builder.Services.AddJobStatusStreaming();
var app = builder.Build();
app.UseWebSockets(); // required only if the WebSocket wire is used
app.MapJobStatusStream(); // default path: /jobs/status/stream
// appsettings.json
"Jobs": {
"Status": {
"Backplane": "Postgres", // None (default) | InMemory | Postgres
"Wire": "Sse" // Sse (default) | WebSocket | Both
}
}
- SSE serves the base path (
/jobs/status/stream). One-directional, browserEventSourceauto-reconnect, proxy-friendly. Frames:event: <kind>\ndata: <JobStatus json>\n\n, plus: keep-aliveheartbeats. - WebSocket serves
{path}/ws. JSON{ kind, status }text frames + app-level heartbeat frames. Bothmounts both. A?job=<name>query narrows a connection to a single job (otherwise all jobs stream).
Each connection subscribes to the pod's backplane, re-queries the store per event in a fresh scope (no DbContext held open for the connection's life), and tolerates a client vanishing mid-stream without faulting the server.
Scale
| Backplane | Reaches | Ceiling |
|---|---|---|
None (poll-only) |
any N replicas | the poll interval — always works |
InMemory |
one process | single replica / local dev |
Postgres LISTEN/NOTIFY |
every replica, no new infra | tens of pods × thousands of clients |
When Postgres fan-out becomes the bottleneck, swap Jobs:Status:Backplane to a broker-backed transport
(e.g. Redis) — the wire is unchanged.
License
MIT.
| 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
- Dloizides.Jobs (>= 1.3.2)
- prometheus-net (>= 8.2.1)
-
net8.0
- Dloizides.Jobs (>= 1.3.2)
- prometheus-net (>= 8.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.