WJb 0.35.0

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

WJb — Background Job System for .NET

NuGet

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 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. 
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
0.35.0 36 6/5/2026
Loading failed