Immediate.Jobs.NodaTime 0.5.0

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

Immediate.Jobs.NodaTime

NuGet Documentation License

NodaTime scheduling overloads and job payload serialization for Immediate.Jobs.

Installation

dotnet add package Immediate.Jobs --prerelease
dotnet add package Immediate.Jobs.NodaTime --prerelease

Immediate.Jobs reports diagnostic IJOB0004 when a generated job payload uses NodaTime types without this package.

Scheduling with NodaTime

Import Immediate.Jobs.NodaTime to schedule with Duration, Instant, and DateTimeZone:

using Immediate.Jobs.NodaTime;
using NodaTime;

JobHandle delayed = await scheduler.ScheduleAsync(
	payload,
	Duration.FromMinutes(15),
	cancellationToken);

JobHandle scheduled = await scheduler.ScheduleAsync(
	payload,
	SystemClock.Instance.GetCurrentInstant() + Duration.FromHours(1),
	cancellationToken);

JobHandle continuation = await scheduler.ScheduleAfterAsync(
	payload,
	scheduled,
	Duration.FromMinutes(5),
	cancellationToken: cancellationToken);

await recurringScheduler.AddOrUpdateRecurringAsync(
	"tenant-cleanup",
	"0 3 * * *",
	DateTimeZoneProviders.Tzdb["Europe/Vienna"],
	cancellationToken);

The same method family covers fair-queue group IDs and workflow construction. Inside an open batch, Schedule accepts an Instant or Duration; ScheduleAfter applies a Duration after one or several parent jobs reach the selected outcome:

await using var batch = batches.Begin();

var root = scheduler.Schedule(payload, batch, SystemClock.Instance.GetCurrentInstant());
var child = scheduler.ScheduleAfter(
	payload,
	root,
	Duration.FromMinutes(10));

_ = await batch.CommitAsync(cancellationToken);

NodaTime overloads also accept JobDetails for work added by a running job. They follow the core scheduler's ContinuationOptions behavior.

Payload serialization

Immediate.Jobs has its own IJobSerializer; it does not use ASP.NET Core's JSON options. When an application owns its JSON settings, create dedicated JsonSerializerOptions and register a NodaTimeJobSerializer before AddMyAppJobs():

using System.Text.Json;
using Immediate.Jobs.NodaTime;
using Immediate.Jobs.Shared.Interfaces;
using NodaTime;

var jobJsonOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web)
{
	WriteIndented = false,
	PropertyNameCaseInsensitive = true,
};

builder.Services.AddMyAppHandlers();

builder.Services.AddSingleton<IJobSerializer>(
	new NodaTimeJobSerializer(
		jobJsonOptions,
		DateTimeZoneProviders.Tzdb
	)
);

builder.Services.AddMyAppJobs()
	.ConfigureStorage(storage => storage.UseInMemory());

NodaTimeJobSerializer adds NodaTime's System.Text.Json converters to the supplied options. Generated schedulers and invokers build their AOT-safe payload metadata from those same options, so custom naming, converters, and other JSON settings apply consistently when a job is written and read.

Register the serializer before AddMyAppJobs(). Jobs registers its default serializer only when no IJobSerializer has already been registered.

If web JSON defaults and the TZDB time-zone provider are sufficient, AddImmediateJobsNodaTime() is a shorter convenience registration:

builder.Services.AddMyAppHandlers();
builder.Services.AddMyAppJobs()
	.ConfigureStorage(storage => storage.UseInMemory());
builder.Services.AddImmediateJobsNodaTime();

The convenience method replaces the default IJobSerializer; do not combine it with the explicit serializer registration above. Pass an IDateTimeZoneProvider to either NodaTimeJobSerializer or AddImmediateJobsNodaTime(...) when the application does not use TZDB.

Every worker that reads stored jobs must use the same serializer options and a time-zone provider that recognizes the same IDs. Treat these settings as part of the durable payload contract: changing converters or JSON names while jobs are still queued can make their stored payloads unreadable.

Call JsonSerializerOptions.UseNodaTime(...) only when JSON options outside the Jobs serializer need the same NodaTime converters.

More information

Product 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 is compatible.  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 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.  net11.0 is compatible. 
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.5.1 0 8/30/2026
0.5.0 41 8/28/2026
0.4.0 105 8/12/2026
0.3.0 92 8/7/2026
0.2.0 109 8/4/2026
0.1.0 102 7/31/2026