JobManager 1.0.0-previe.2
This is a prerelease version of JobManager.
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package JobManager --version 1.0.0-previe.2
NuGet\Install-Package JobManager -Version 1.0.0-previe.2
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="JobManager" Version="1.0.0-previe.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JobManager" Version="1.0.0-previe.2" />
<PackageReference Include="JobManager" />
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 JobManager --version 1.0.0-previe.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JobManager, 1.0.0-previe.2"
#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 JobManager@1.0.0-previe.2
#: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=JobManager&version=1.0.0-previe.2&prerelease
#tool nuget:?package=JobManager&version=1.0.0-previe.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ToolWheel JobManager
A modular, extensible and testable infrastructure for defining, scheduling, executing and safeguarding background jobs in .NET 8 applications.
Overview
| Property | Value |
|---|---|
| Target Framework | net8.0 |
| Architecture | Modular – abstractions, core runtime, triggers, filters, execution conditions, job groups |
| Packaging | Several modules ship as NuGet packages |
Projects
| Project | Purpose |
|---|---|
ToolWheel.Extensions.JobManager.Abstractions |
Public API – interfaces (IJob, IJobTask, IJobService, …), DTOs, configuration contracts and the middleware / execution-condition abstractions. |
ToolWheel.Extensions.JobManager |
Core runtime – default implementations (JobService, JobTaskService, JobTaskExecutionService), DI registration via AddJobManager() and the startup-class pattern. |
ToolWheel.Extensions.JobManager.ExecutionConditions |
Pre-execution condition evaluators – ships the JobTaskLimiterCondition that enforces a maximum number of concurrent tasks per job. Auto-configured via IAutoFeatureConfigurator. |
ToolWheel.Extensions.JobManager.JobGroups |
Job grouping – allows assigning jobs to named groups so that only one job per group runs at a time (JobGroupCondition). |
ToolWheel.Extensions.JobManager.Triggers.Abstractions |
Trigger API – ITrigger, ISchedulableTrigger, ITriggerFilter, the TriggerBackgroundService and the fluent trigger/filter builder interfaces. |
ToolWheel.Extensions.JobManager.Triggers |
Built-in triggers and filters – IntervalTrigger, DateTrigger, FileWatcherTrigger, AppStatusChangedTrigger, JobCompletionHockTrigger and filters such as TimeWindowTriggerFilter, DayOfWeekTriggerFilter, MonthBoundaryTriggerFilter, QuarterBoundaryTriggerFilter. |
ToolWheel.Extensions.JobManager.Triggers.Cron |
Cron trigger – CronTrigger powered by the Cronos library (5- and 6-field expressions). |
ToolWheel.Applications.JobManager |
Standalone console host – runs the job manager as a long-running process with a plugin system for dynamically loading/unloading job assemblies at runtime. |
Quick Start
1. Register the Job Manager
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddJobManager(configure =>
{
configure.ConfigureJobs(jobs =>
{
var worker = new MyWorker();
jobs.Add("my-job", worker.DoWork)
.Name("My Job")
.Description("Processes pending items")
.Enabled();
});
});
var app = builder.Build();
await app.RunAsync();
2. Using the Startup Class Pattern
builder.Services.AddJobManager<MyJobManagerStartup>();
public class MyJobManagerStartup : JobManagerStartup
{
public override void ConfigureJobManager(IJobManagerConfigurationBuilder configure)
{
// Register middleware, execution conditions, services …
}
public override void ConfigureJobs(IJobDescriptionCollection collection)
{
var worker = new MyWorker();
collection.Add("import-job", worker.ImportData)
.Name("Data Import")
.Enabled();
}
}
3. Adding Triggers
jobs.Add("scheduled-job", worker.Process)
.Name("Scheduled Job")
.Enabled()
.Trigger()
.WithInterval(TimeSpan.FromMinutes(5), fireImmediately: true)
.And();
4. Executing Jobs Manually
public class MyController
{
private readonly IJobService _jobService;
public MyController(IJobService jobService)
{
_jobService = jobService;
}
public async Task RunJobAsync(string jobId, CancellationToken ct)
{
var job = _jobService.ReadById(jobId);
IJobTask task = await _jobService.ExecuteAsync(job, ct);
// task.Status, task.Journal, task.CancellationToken …
}
}
Key Concepts
- Job – An
IJobwraps aMethodInfo+ optional target instance that represents the unit of work. - JobTask – An
IJobTaskis a runtime handle for a single execution, tracking status (Pending,Running,Success,Canceled,Failed), cancellation token, result and journal entries. - Execution Condition – An
IExecutionConditionis evaluated before a job runs. If any condition sets the result to not ready, execution is skipped. - Middleware –
IExecutionMiddlewarecomponents form a pipeline around each job task execution (e.g. resolving the target object, evaluating conditions). - Trigger – An
ITriggerdecides autonomously whether to fire.ISchedulableTriggeradditionally predicts its next fire time for adaptive polling. - Trigger Filter – An
ITriggerFiltercan block a trigger based on time windows, day-of-week, month/quarter boundaries etc. - Job Group – Groups ensure mutual exclusion: only one job within a group may run at a time.
Extensibility
- Implement
IExecutionConditionorIExecutionMiddlewareand register them via the configuration builder. - Implement
ITrigger/ISchedulableTriggerfor custom scheduling strategies. - Implement
ITriggerFilterfor custom trigger-level gating logic. - Add persistence integrations (e.g. database-backed job stores) through DI.
- The
IAutoFeatureConfiguratorinterface enables packages to self-register into the pipeline on assembly load.
| Product | Versions 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 was computed. 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 was computed. 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.
-
net8.0
- Microsoft.Extensions.Hosting (>= 10.0.3)
- ToolWheel.Extenions.JobManager (>= 1.0.0-previe.2)
- ToolWheel.Extensions.JobManager.Abstractions (>= 1.0.0-previe.2)
- ToolWheel.Extensions.JobManager.Triggers (>= 1.0.0-previe.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 |
|---|