DioRed.Common.Jobs
2.0.0
See the version list below for details.
dotnet add package DioRed.Common.Jobs --version 2.0.0
NuGet\Install-Package DioRed.Common.Jobs -Version 2.0.0
<PackageReference Include="DioRed.Common.Jobs" Version="2.0.0" />
<PackageVersion Include="DioRed.Common.Jobs" Version="2.0.0" />
<PackageReference Include="DioRed.Common.Jobs" />
paket add DioRed.Common.Jobs --version 2.0.0
#r "nuget: DioRed.Common.Jobs, 2.0.0"
#:package DioRed.Common.Jobs@2.0.0
#addin nuget:?package=DioRed.Common.Jobs&version=2.0.0
#tool nuget:?package=DioRed.Common.Jobs&version=2.0.0
DioRed.Common.Jobs
Lightweight in-process scheduling primitives for one-time and recurring jobs (.NET 10+).
Key types
ISchedule- stateless schedule definition.- Built-in schedules:
OneTimeScheduleIntervalScheduleDailySchedule(fixed UTC offset)LocalTimeDailySchedule(usesTimeZoneInfo.Local)CronSchedule(5- or 6-field CRON)
Job- runs an async/sync delegate according to a schedule.
Schedule contract
ISchedule.GetNextOccurrence(DateTimeOffset after) returns the next occurrence that is strictly greater than after.
Return null when the schedule is exhausted.
Example (interval)
using DioRed.Common.Jobs;
var job = new Job(
action: async ct =>
{
// Your work here
await Task.Delay(250, ct);
},
schedule: new IntervalSchedule(TimeSpan.FromMinutes(5)),
options: new JobOptions
{
MaxOccurrences = null, // run until cancelled
TimeProvider = TimeProvider.System
}
);
job.Scheduled += (_, e) => Console.WriteLine($"Next: {e.NextOccurrence:o}");
job.OccurrenceStarted += (_, e) => Console.WriteLine($"Start #{e.OccurrenceNumber} at {e.StartedAt:o}");
job.OccurrenceFinished += (_, e) => Console.WriteLine($"Finish #{e.OccurrenceNumber} ({e.Duration})");
job.Faulted += (_, e) => Console.WriteLine($"Faulted: {e.Exception}");
var task = job.StartAsync();
// Later:
// job.Cancel();
await task;
Example (cron)
Every day at 03:30 local time:
var job = new Job(
action: ct => DoSomethingAsync(ct),
schedule: new CronSchedule("30 3 * * *"),
options: new JobOptions { MaxOccurrences = null }
);
await job.StartAsync();
Every 10 seconds in UTC:
var job = new Job(
action: ct => TickAsync(ct),
schedule: new CronSchedule("*/10 * * * * *", TimeZoneInfo.Utc)
);
await job.StartAsync();
CRON notes
- Supported fields:
*, lists (1,2,3), ranges (1-5), steps (*/5,1-10/2). - Month names:
JAN..DEC, day names:SUN..SAT. - Day-of-month and day-of-week follow traditional cron semantics:
- if one of them is a wildcard, the other must match
- if both are restricted, match if either matches (OR)
- you can use
?to mark the field as "no specific value".
Misfire handling
If the job wakes up after a scheduled time (for example, machine sleep / long GC pause), it detects a misfire when:
now - scheduledFor > MisfireThreshold (defaults to 1 second).
Choose behavior with JobOptions.MisfirePolicy:
Skip(default) — skip missed occurrences.FireOnce— run once immediately, then continue from "now".CatchUp— run missed occurrences sequentially (up toMaxCatchUpExecutions), then continue.
var job = new Job(
action: ct => WorkAsync(ct),
schedule: new CronSchedule("0 */5 * * *"),
options: new JobOptions
{
MisfirePolicy = MisfirePolicy.CatchUp,
MaxCatchUpExecutions = 5,
MisfireThreshold = TimeSpan.FromSeconds(2)
}
);
job.Misfired += (_, e) => Console.WriteLine($"Late by {e.Lateness} (policy: {e.Policy})");
await job.StartAsync();
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DioRed.Common.Jobs:
| Package | Downloads |
|---|---|
|
DioRed.Vermilion.Core
Core engine for Vermilion: message model, command handling pipeline, clients policy and runtime primitives. Use with DioRed.Vermilion.Hosting to run bots in a Generic Host. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.1 | 89 | 12/29/2025 |
| 2.0.0 | 189 | 12/22/2025 |
| 1.8.1 | 1,139 | 11/30/2024 |
| 1.8.0 | 262 | 11/14/2024 |
| 1.7.0 | 1,179 | 5/22/2024 |
| 1.6.0 | 197 | 5/22/2024 |
| 1.4.2 | 398 | 5/10/2024 |
| 1.4.1 | 177 | 5/10/2024 |
| 1.4.0 | 185 | 5/10/2024 |
| 1.3.0 | 181 | 5/10/2024 |
| 1.2.0 | 209 | 4/6/2024 |
| 1.1.1 | 314 | 11/16/2023 |
| 1.1.0 | 178 | 11/16/2023 |
| 1.0.0 | 284 | 6/6/2023 |