Rask.Jobs 0.20.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Rask.Jobs --version 0.20.0
                    
NuGet\Install-Package Rask.Jobs -Version 0.20.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="Rask.Jobs" Version="0.20.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rask.Jobs" Version="0.20.0" />
                    
Directory.Packages.props
<PackageReference Include="Rask.Jobs" />
                    
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 Rask.Jobs --version 0.20.0
                    
#r "nuget: Rask.Jobs, 0.20.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 Rask.Jobs@0.20.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=Rask.Jobs&version=0.20.0
                    
Install as a Cake Addin
#tool nuget:?package=Rask.Jobs&version=0.20.0
                    
Install as a Cake Tool

Rask.Jobs

Durable background jobs for a Rask app — enqueued work that runs off the request thread, stored in the app's own database, with no broker or Redis.

  • Mark a type IJob and it dispatches to an ordinary Rask.Cqrs ICommandHandler<TJob> — a job is a command executed later.
  • A background JobProcessor polls the Job table and runs each due job — at-least-once, with exponential-backoff retries up to MaxAttempts (then left as a dead letter for inspection).
  • Delayed (ScheduleAsync(job, delay)) and durable interval-recurring (AddRecurring<T>(name, every, …)) jobs — recurring runs are tracked in the DB, so a restart never double-runs them. Read the schedule back from JobOptions.RecurringJobs.
  • Metrics on the Rask.Jobs meter: processed / failed / dead-lettered counters, a duration histogram, and pending / dead-letter gauges. rask.jobs.deadletters is the one to alert on.
  • A source generator registers every IJob type for reflection-free rehydration on the run path.

Use

public sealed record SendWelcomeEmail(Guid UserId) : IJob;

public sealed class SendWelcomeEmailHandler(IEmailSender email) : ICommandHandler<SendWelcomeEmail>
{
    public Task HandleAsync(SendWelcomeEmail cmd, CancellationToken ct) => email.SendWelcomeAsync(cmd.UserId, ct);
}

// Program.cs
builder.Services.AddRaskCqrs();
builder.Services.AddRaskJobs<AppDbContext>(o =>
    o.AddRecurring<PurgeStaleCarts>("purge-carts", every: TimeSpan.FromHours(1), () => new PurgeStaleCarts()));

// AppDbContext.OnModelCreating:  modelBuilder.AddRaskJobs();
// then:  rask db add AddJobs && rask db update
// enqueue from anywhere IJobQueue is injected:
await jobs.EnqueueAsync(new SendWelcomeEmail(user.Id));
await jobs.ScheduleAsync(new SendReminder(order.Id), delay: TimeSpan.FromHours(24));

Register your context as an IDbContextFactory<AppDbContext> (Rask Server sessions are long-lived). Several instances is safe: each processor leases the batch it claims, so a job runs on exactly one of them. On SQLite you will still usually run one, because SQLite is single-writer, so the processor claims work by polling and writing sequentially. Need a job to commit atomically with a business change? Raise a domain event and deliver it with Rask.Outbox instead — the two pillars are complementary.

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 (2)

Showing the top 2 NuGet packages that depend on Rask.Jobs:

Package Downloads
Rask.Dashboard

A built-in operator dashboard for the Rask One Person Framework batteries. Mounts at /_rask and shows the outbox, background jobs, queued mail and cache from the application's own database — queue depth, dead letters, the errors behind them, stored email previews, the recurring-job schedule, SQLite pragmas and backup status. A live log tail is built in, and becomes a searchable history when Rask.Logging is installed. Panels appear only for the batteries the app actually registered. Protected by an authorization policy that fails closed outside Development.

Rask

The one reference a Rask application needs, server or browser. On net10.0 it brings the ASP.NET host plus every battery — database, mediator, background jobs, transactional email, cache, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On net10.0-browser it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.20.1-alpha.0.228 29 9/4/2026
0.20.1-alpha.0.227 31 9/4/2026
0.20.1-alpha.0.226 35 9/4/2026
0.20.1-alpha.0.225 36 9/4/2026
0.20.1-alpha.0.224 35 9/4/2026
0.20.1-alpha.0.223 38 9/4/2026
0.20.1-alpha.0.221 36 9/4/2026
0.20.1-alpha.0.220 34 9/4/2026
0.20.1-alpha.0.217 34 9/4/2026
0.20.1-alpha.0.216 37 9/4/2026
0.20.1-alpha.0.215 40 9/3/2026
0.20.1-alpha.0.213 35 9/3/2026
0.20.1-alpha.0.212 41 9/3/2026
0.20.1-alpha.0.211 43 9/3/2026
0.20.1-alpha.0.210 42 9/3/2026
0.20.1-alpha.0.209 37 9/2/2026
0.20.1-alpha.0.208 36 9/2/2026
0.20.1-alpha.0.207 44 9/2/2026
0.20.1-alpha.0.206 42 9/2/2026
0.20.0 113 8/6/2026
Loading failed