Cronograph 1.0.46

dotnet add package Cronograph --version 1.0.46
NuGet\Install-Package Cronograph -Version 1.0.46
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="Cronograph" Version="1.0.46" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cronograph --version 1.0.46
#r "nuget: Cronograph, 1.0.46"
#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.
// Install Cronograph as a Cake Addin
#addin nuget:?package=Cronograph&version=1.0.46

// Install Cronograph as a Cake Tool
#tool nuget:?package=Cronograph&version=1.0.46

Cronograph - Simple Cronjob runner

Overview

Simple Cronjob runner created as a HangFire replacement for the times where you just need an inprocess job execution engine. Hangfire can be found here. Cronograph is easily testable and integrates well into Microsoft.Extensions.DependencyInjection.

Install the Cronograph nuget package using the following command in the package manager console window

PM> Install-Package Cronograph

The Nuget package can be found here

Features

The following features are found in Cronograph:

  • Single process job execution
  • Recurring jobs based on Cron schedules
  • Fire-and-forget jobs
  • Delayed run-once jobs

The following features are NOT found in Cronograph:

  • Scaling out on multiple physical processes and servers
  • Job Continuations
  • Groups/batches of jobs
  • Automatic retries

Usage

In order just to get the simplest cron job up and running in a minimal ASP.NET Core API. Do the following:

using Cronograph;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCronograph(builder.Configuration);
var app = builder.Build();
var cronograph = app.Services.GetRequiredService<ICronograph>();
cronograph.AddJob("Test job", (cancellationToken) => { Console.WriteLine("Boom!"); return Task.CompletedTask; }, "*/10 * * * * *");
app.Run();

Cronograph also supports cron job classes using the interface IScheduledService. This can be acheived in the following way:

using Cronograph;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCronograph(builder.Configuration);
var app = builder.Build();
var cronograph = app.Services.GetRequiredService<ICronograph>();
cronograph.AddScheduledService<MyService>("Test service", "*/10 * * * * *");
app.Run();

And with the following scheduled service:

public class MyService : IScheduledService
{
    public Task ExecuteAsync(CancellationToken stoppingToken)
    {
        Console.WriteLine("Scheduled service boom!");
        return Task.CompletedTask;
    }
}

UserInterface

Crongraph has a simple user interface to visualize the jobs currently registred on the system. Add the following NuGET package:

PM> Install-Package Cronograph.UI

And then add the following line of code to your program.cs:

using Cronograph.UI;

var app = builder.Build();
 // Add this..
app.UseCronographUI();

app.Run();

And you should be able to see the user interface on https://YourFantasticMachineAnd:port/Cronograph

Cronograph UI

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.0.46 48 4/26/2024
1.0.43 88 4/16/2024
1.0.42 75 4/16/2024
1.0.41 78 4/15/2024
1.0.40 74 4/15/2024
1.0.39 66 4/15/2024
1.0.38 77 4/15/2024
1.0.37 74 4/15/2024
1.0.36 74 4/15/2024
1.0.35 72 4/15/2024
1.0.34 81 4/14/2024
1.0.33 94 4/11/2024
1.0.31 98 4/4/2024
1.0.30 77 4/4/2024
1.0.26 307 10/16/2023
1.0.25 337 9/11/2023
1.0.19 127 9/11/2023
1.0.18 145 9/11/2023
1.0.17 282 12/13/2022
1.0.16 285 12/11/2022
1.0.15 311 12/7/2022
1.0.14 311 12/7/2022
1.0.13 307 12/7/2022
1.0.12 301 12/7/2022
1.0.11 410 12/5/2022
1.0.10 314 12/5/2022
1.0.9 336 12/5/2022
1.0.8 323 12/5/2022
1.0.7 317 12/5/2022
1.0.6 323 12/4/2022
1.0.5 306 12/4/2022
1.0.3 305 12/4/2022
1.0.2 328 12/4/2022
1.0.1 302 12/4/2022