WJb 0.35.0
dotnet add package WJb --version 0.35.0
NuGet\Install-Package WJb -Version 0.35.0
<PackageReference Include="WJb" Version="0.35.0" />
<PackageVersion Include="WJb" Version="0.35.0" />
<PackageReference Include="WJb" />
paket add WJb --version 0.35.0
#r "nuget: WJb, 0.35.0"
#:package WJb@0.35.0
#addin nuget:?package=WJb&version=0.35.0
#tool nuget:?package=WJb&version=0.35.0
WJb — Background Job System for .NET
Overview
WJb is a lightweight background job system for .NET focused on
explicit execution, deterministic behavior, and clean architecture.
It separates job definition, execution, and storage into independent layers,
allowing applications to scale from simple in-memory processing to advanced systems.
Architecture
WJb.Abstractions
"Contracts only — no implementation"
- Job contracts (
IJob,IJobAction) - Execution interfaces
- Factory contracts
- Query models
WJb.Core
"I define how jobs behave"
- Job model (
Job<TAction, TPayload>) - Job state lifecycle
- Execution context (
JobContext) - Middleware pipeline
WJb.Runtime
"I execute jobs"
- In-memory job store
- Worker loop (
WJbHostedWorker) - Concurrency control
- ActionFactory (runtime dispatch)
- Job lifecycle management
WJb.Extensions
"I wire everything together"
AddWJb()DI bootstrap- Pipeline configuration
- Middleware registration
- WASM worker support
WJb.Pro (commercial)
"I make execution reliable and scalable"
- Advanced retry policies
- Delivery guarantees
- High-load processing
WJb.Sql (planned)
"I persist jobs"
- Durable storage
- Restart recovery
- Long-running workflows
Features
- ✅ In-memory job processing
- ✅ FIFO queue
- ✅ Queue / History separation
- ✅ Middleware pipeline
- ✅ Configurable retry system
- ✅ Deterministic execution model
- ✅ Query API (filtering / sorting / paging)
- ✅ Concurrency control
- ✅ Works in ASP.NET, Worker Services, and WASM
Quick Start
services
.AddWJb(o =>
{
o.MaxConcurrency = 3;
})
.UseMemory()
.UseRetry()
.AddActions(b =>
{
b.Add<MyAction, string>();
});
Job Example
public class MyAction : IJobAction<string>
{
public Task ExecuteAsync(JobContext ctx, string payload)
{
ctx.ReportProgress(50, "Processing...");
ctx.Complete();
return Task.CompletedTask;
}
}
Enqueue Jobs
engine.Enqueue<MyAction, string>("hello world");
// or dynamic
engine.Enqueue("MyAction", "hello world");
// or JSON
engine.EnqueueJson("MyAction", "\"hello world\"");
Execution Model
- FIFO queue
- Explicit state transitions:
Queued → Processing → Completed / Failed / Cancelled → History
- Concurrency-safe execution
- Worker-driven processing (
TickAsync) - Middleware-based behavior
Query API
var jobs = engine.GetHistory(new JobQuery
{
Statuses = new[] { JobStatus.Failed, JobStatus.Cancelled },
Skip = 0,
Take = 10,
Desc = true
});
Supported:
- Filtering by status
- Time range (
From / To) - Sorting (
Desc / Asc) - Pagination (
Skip / Take)
Retry Model
- Triggered via middleware (
UseRetry) - Applies only to failed jobs
On retry:
- Attempts incremented
- Delay applied (configurable)
- Job returned to queue
- Cancellation reset
Middleware Pipeline
WJb allows custom execution behaviors:
builder.UseRetry();
builder.UseMiddleware<MyMiddleware>();
Middleware can:
- Catch exceptions
- Modify job state
- Implement retry logic
- Add logging / telemetry
WASM Support
await serviceProvider.UseWasmWorkerAsync(ct);
- Lightweight loop (no hosted service)
- Works in Blazor WebAssembly
- Cancellation-controlled execution
Configuration (WJbOptions)
services.AddWJb(o =>
{
o.MaxConcurrency = 5;
o.RetryDelayFactory = attempt =>
TimeSpan.FromSeconds(Math.Pow(2, attempt));
});
Limitations (Base)
- ❌ No persistence (in-memory only)
- ❌ No distributed execution
- ❌ No delivery guarantees
- ❌ Retry is best-effort (non-durable)
License
WJb is distributed under a Commercial Capability License.
- ✅ Free for personal and non-commercial use
- ❌ Commercial use requires a paid license
Philosophy
Background jobs should be explicit, predictable,
and fully controlled by application code.
WJb avoids hidden magic and focuses on:
- clear execution flow
- testability
- composability
| 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
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.