### Start a New Batch Job Source: https://www.hangfire.io Initiate a batch of background jobs that are created atomically and treated as a single unit. Returns a batch ID. ```csharp var batchId = BatchJob.StartNew(x => { x.Enqueue(() => Console.WriteLine("Job 1")); x.Enqueue(() => Console.WriteLine("Job 2")); }); ``` -------------------------------- ### Enqueue a Fire-and-Forget Background Job Source: https://www.hangfire.io Use this to execute a background job exactly once, almost immediately after creation. The job ID is returned for potential future reference. ```csharp var jobId = BackgroundJob.Enqueue( () => Console.WriteLine("Fire-and-forget!")); ``` -------------------------------- ### Add a Continuation Job Source: https://www.hangfire.io Create a job that executes only after its parent job has successfully completed. Requires the parent job ID. ```csharp BackgroundJob.ContinueJobWith( jobId, () => Console.WriteLine("Continuation!")); ``` -------------------------------- ### Add a Batch Continuation Job Source: https://www.hangfire.io Define a job that runs after all background jobs within a specified parent batch have finished. Requires the batch ID. ```csharp BatchJob.ContinueBatchWith(batchId, x => { x.Enqueue(() => Console.WriteLine("Last Job")); }); ``` -------------------------------- ### Schedule a Delayed Background Job Source: https://www.hangfire.io Schedule a job to run once after a specified time interval. The job ID is returned for potential future reference. ```csharp var jobId = BackgroundJob.Schedule( () => Console.WriteLine("Delayed!"), TimeSpan.FromDays(7)); ``` -------------------------------- ### Add a Recurring Background Job Source: https://www.hangfire.io Add a job that runs multiple times on a defined CRON schedule. This is useful for periodic tasks. ```csharp RecurringJob.AddOrUpdate( "myrecurringjob", () => Console.WriteLine("Recurring!"), Cron.Daily); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.