NexJob 0.7.0
See the version list below for details.
dotnet add package NexJob --version 0.7.0
NuGet\Install-Package NexJob -Version 0.7.0
<PackageReference Include="NexJob" Version="0.7.0" />
<PackageVersion Include="NexJob" Version="0.7.0" />
<PackageReference Include="NexJob" />
paket add NexJob --version 0.7.0
#r "nuget: NexJob, 0.7.0"
#:package NexJob@0.7.0
#addin nuget:?package=NexJob&version=0.7.0
#tool nuget:?package=NexJob&version=0.7.0
<div align="center">
<br/>
███╗ ██╗███████╗██╗ ██╗ ██╗ ██████╗ ██████╗
████╗ ██║██╔════╝╚██╗██╔╝ ██║██╔═══██╗██╔══██╗
██╔██╗ ██║█████╗ ╚███╔╝ ██║██║ ██║██████╔╝
██║╚██╗██║██╔══╝ ██╔██╗ ██ ██║██║ ██║██╔══██╗
██║ ╚████║███████╗██╔╝ ██╗╚█████╔╝╚██████╔╝██████╔╝
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═════╝
Background jobs for .NET. Predictable. Observable. No magic.
<br/>
</div>
NexJob
Background jobs that execute reliably and enforce deadlines. No hidden state. No surprises in production.
Jobs expire if not started in time. Storage is authoritative. State transitions are persisted. This is how background processing should work.
Why NexJob
- Deadlines are enforced: Jobs expiring before execution are marked
Expiredand skipped. No silent failures. - Storage owns state: All state persisted. Multi-instance safe from day one. Dispatcher is stateless.
- Predictable execution: No serialization. Jobs run natively with async/await. One job instance per execution.
- Explicit failure handling: Retries are configured. Dead-letter handlers trigger for permanent failures.
- Built for visibility: Live timeline, execution history, failure tracking. OpenTelemetry integration.
- No hidden behavior: What you see is what happens. Clear, deterministic execution model.
Key Features
- Deadline enforcement — jobs expire if not started in time
- Dead-letter handlers — handle permanent failures automatically
- Retry policies — global and per-job control
- Resource throttling — limit concurrency per resource
- Live dashboard — execution timeline, history, observability
- Graceful shutdown — jobs complete naturally; strays are requeued
- All storage providers free — PostgreSQL, SQL Server, Redis, MongoDB
- Live config — pause/resume, adjust workers at runtime
Quick Example
Define a job:
public class SendInvoiceJob : IJob<SendInvoiceInput>
{
private readonly IEmailService _email;
public SendInvoiceJob(IEmailService email) => _email = email;
public async Task ExecuteAsync(SendInvoiceInput input, CancellationToken ct)
=> await _email.SendAsync(input.Email, "Invoice attached", ct);
}
Register and enqueue with deadline:
builder.Services.AddNexJob(builder.Configuration)
.AddNexJobJobs(typeof(Program).Assembly);
var scheduler = app.Services.GetRequiredService<IScheduler>();
// Enqueue with 5-minute deadline. Job expires if not started in time.
await scheduler.EnqueueAsync<SendInvoiceJob, SendInvoiceInput>(
new(orderId, email),
deadlineAfter: TimeSpan.FromMinutes(5));
Job executes immediately on an available worker. If it misses the deadline, it's marked Expired and skipped.
Dashboard
Visual timeline, not logs.
Logs force you to reconstruct what happened. The dashboard shows it directly: every job's exact state and when it transitioned. See failures, retries, expired jobs, and execution timing at a glance.
Live progress reporting for long-running jobs:
public async Task ExecuteAsync(ImportInput input, CancellationToken ct)
{
await _ctx.ReportProgressAsync(0, "Starting...", ct);
// ... do work ...
await _ctx.ReportProgressAsync(100, "Done.", ct);
}
Enable it:
app.UseNexJobDashboard("/dashboard");
One dashboard view. Full system visibility. No investigation required.
Core Concepts
Job Types
IJob— jobs with no inputIJob<T>— jobs with structured input
Lifecycle
Jobs move through states: Enqueued → Processing → Succeeded (or Failed → retry).
Terminal states: Dead-letter (exhausted retries), Expired (deadline missed).
Deadlines
Set at enqueue. Checked before execution. Expired jobs are marked Expired and skipped:
await scheduler.EnqueueAsync<PaymentJob, PaymentInput>(
input,
deadlineAfter: TimeSpan.FromMinutes(5));
Retries
Global policy. Per-job override:
[Retry(5, InitialDelay = "00:00:30", Multiplier = 2.0, MaxDelay = "01:00:00")]
public class PaymentJob : IJob<PaymentInput> { ... }
Dead-Letter Handling
Triggered when retries exhausted. Handler runs in isolated scope:
public class PaymentDeadLetterHandler : IDeadLetterHandler<PaymentJob>
{
public async Task HandleAsync(JobRecord failedJob, Exception lastException, CancellationToken ct)
=> await _alerts.SendAsync("Payment failed", ct);
}
builder.Services.AddTransient<IDeadLetterHandler<PaymentJob>, PaymentDeadLetterHandler>();
Installation
# Core
dotnet add package NexJob
# Storage (pick one)
dotnet add package NexJob.Postgres
dotnet add package NexJob.SqlServer
dotnet add package NexJob.Redis
dotnet add package NexJob.MongoDB
# Dashboard (optional)
dotnet add package NexJob.Dashboard
Philosophy
Explicit behavior over magic. Jobs execute natively. Storage owns state. Deadlines are enforced. Failures are handled, not hidden. If it's not obvious from the code, it's not in NexJob.
Roadmap
v0.4.0 ✅ Deadlines, dead-letter handlers, wake-up signaling
v1.0.0 ○ Stable API, production hardened, all providers tested
v2.0.0 ○ Distributed coordination, multi-node consistency
<div align="center"> <br/>
Built with obsession over developer experience and production reliability.
<br/>
© 2025 Luciano Azevedo
</div>
| 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 was computed. 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. |
-
net8.0
- Cronos (>= 0.8.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on NexJob:
| Package | Downloads |
|---|---|
|
NexJob.Dashboard
Blazor SSR dashboard middleware for NexJob — real-time monitoring of background jobs. |
|
|
NexJob.Postgres
PostgreSQL storage provider for NexJob — the open-source background job scheduler for .NET 8+. |
|
|
NexJob.MongoDB
MongoDB storage provider for NexJob — the open-source background job scheduler for .NET 8+. |
|
|
NexJob.SqlServer
SQL Server storage provider for NexJob. |
|
|
NexJob.Redis
Redis storage provider for NexJob. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 83 | 4/8/2026 |
| 0.8.0 | 78 | 4/8/2026 |
| 0.7.0 | 123 | 4/7/2026 |
| 0.6.0 | 162 | 4/3/2026 |
| 0.5.2 | 168 | 4/1/2026 |
| 0.5.1 | 158 | 4/1/2026 |
| 0.5.0 | 168 | 3/31/2026 |
| 0.4.0 | 163 | 3/31/2026 |
| 0.3.2 | 206 | 3/28/2026 |
| 0.3.1 | 219 | 3/28/2026 |
| 0.3.0 | 181 | 3/27/2026 |
| 0.2.0 | 178 | 3/27/2026 |
| 0.1.1 | 131 | 3/27/2026 |
| 0.1.0 | 122 | 3/26/2026 |
| 0.1.0-alpha | 123 | 3/26/2026 |