WJb 1.0.0-beta1
dotnet add package WJb --version 1.0.0-beta1
NuGet\Install-Package WJb -Version 1.0.0-beta1
<PackageReference Include="WJb" Version="1.0.0-beta1" />
<PackageVersion Include="WJb" Version="1.0.0-beta1" />
<PackageReference Include="WJb" />
paket add WJb --version 1.0.0-beta1
#r "nuget: WJb, 1.0.0-beta1"
#:package WJb@1.0.0-beta1
#addin nuget:?package=WJb&version=1.0.0-beta1&prerelease
#tool nuget:?package=WJb&version=1.0.0-beta1&prerelease
📘 WJb — Lightweight Priority Job Runner for .NET
🚀 What is WJb?
WJb is a lightweight, priority‑aware, workflow‑capable background job runner for .NET. It focuses on simplicity, predictability, testability, and full control — without forcing EF Core, hosted queues, or external services.
⭐ Features
- ✔ In‑memory priority queue (ASAP / High / Normal / Low) with backpressure, fairness & in‑flight limits
- ✔ Parallel job processing (
MaxParallelJobs) - ✔ DI-friendly Actions (
IAction/IActionFactory) - ✔ Workflow chaining (success → next, failure → fail)
- ✔ Cron‑based scheduling (
JobScheduler) - ✔ JSON-based job payloads
- ✔ Built‑in Telemetry — Metrics + Activity tracing
📦 Install
dotnet add package WJb
🛠️ Register in Program.cs
services.AddWJbActions(map =>
{
map["Email"] = new ActionItem(
type: typeof(EmailAction).AssemblyQualifiedName!,
more: new JsonObject());
});
services.AddWJbBase(opts =>
{
opts["MaxParallelJobs"] = 4;
});
📨 Enqueue a Job
await processor.EnqueueJobAsync(
await processor.CompactAsync("Email", new { to = "user@example.com" }),
Priority.High);
🔁 Workflow Chaining
WJb supports deterministic branching using next_* and fail_* keys.
{
"Start": {
"type": "WorkflowAction",
"more": {
"next": "SendEmail",
"next_to": "user@example.com",
"fail": "LogError",
"fail_message": "Startup failed"
}
},
"SendEmail": {
"type": "EmailAction",
"more": {
"from": "noreply@example.com",
"subject": "Welcome!"
}
},
"LogError": {
"type": "LogAction",
"more": { "level": "Error" }
}
}
Rules
- Only
next_*/fail_*keys are forwarded - Prefix removed → merged into next action
- Child‑wins merge (job overrides action defaults)
- Priority may be overridden using:
next_priorityfail_priority
Telemetry & Metrics (since 0.23+)
WJb now includes first‑class Telemetry:
✔ Metrics via System.Diagnostics.Metrics
Built‑in instruments:
Counters
jobs_queuedjobs_compactedjobs_expandedjobs_startedjobs_completedjobs_failed
Histograms
job_duration_ms(per job execution)
Every measurement includes rich tags (e.g., action_type, priority, reason, outcome).
Example Setup
var meter = new Meter("WJb.JobProcessor", "1.0.0");
services.Configure<WJbTelemetryOptions>(opts =>
{
opts.OnJobCompleted = evt => Console.WriteLine($"Job completed: {evt.ActionName}");
});
🧭 Activity Tracing (OpenTelemetry‑friendly)
WJb emits:
WJb.Job— per-job execution activityWJb.JobEnqueued— enqueue events
Tags include:
actionNamepriorityattemptdurationMs
Works with:
- OpenTelemetry Collector
- Azure Application Insights
- Jaeger / Zipkin
- Grafana Tempo
⏳ Priority Queue
The in‑memory queue includes:
Backpressure
Blocking writers when per‑priority queues are full.
Per‑priority concurrency limits
MaxInFlightASAP, MaxInFlightHigh, MaxInFlightNormal, MaxInFlightLow
Fairness
Weighted round‑robin:
WeightASAPWeightHighWeightNormalWeightLow
Ensures:
- High responsiveness for ASAP/High
- Guaranteed progress for Normal/Low
🏷 License
MIT License (see LICENSE file)
🙌 Support
If WJb helps you — ⭐ the repo or support via PayPal.
| 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.Abstractions (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
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 |
|---|---|---|
| 1.0.0-beta1 | 1,010 | 1/14/2026 |
| 0.25.0-beta | 1,979 | 1/12/2026 |