In Hangfire, I have successfully set recurring jobs and am able to trigger manually if I want to, thanks to the Web UI and its \"trigger\" button.
RecurringJob.A
Manual or "on demand" have not yet been implemented in the main trunk. However you can use this fork to have that option.
Currently this is marked as Work in Progress in Hangfire's repo and you can use it as this:
BackgroundJob.Stash(() => Console.WriteLine("STASHING"));
A different approach mentioned in one of the comments is to have somewhere in your site a button that enqueues the job:
BackgroundJob.Enqueue(() => Console.WriteLine("Simple!"));
EDIT: 2017/12/28:
Apparently the previous fork wont be merged back since this extension already supports to manually queue jobs:
Hangfire.Core.Dashboard.Management
I use this CRON expression as Never: 0 0 29 2/12000 WED At midnight, on a 29th of Feb that happens to be a Wednesday, every century.
As @youen found out, this expression yields a later date. "0 0 29 2/12000 MON"
Yes, on demand jobs are entirely possible with hangfire. You can trigger fire-and-forget jobs using the following:
BackgroundJob.Enqueue(
() => Console.WriteLine("Simple!"));
This however won't appear in the hangfire dashboard, but you can use the above snippet in your code (Perhaps after a button click?)
I used this (hangfire 1.7 on .net 4.6.2)
RecurringJob.AddOrUpdate(() => ..., "0 0 31 2 0");
It shows up in the dashboard as:
Next execution N/A