add-background-job

Schedule recurring and one-time background jobs in .NET with Hangfire.

1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/Emmanuelkwaa/NetRockTemplate --skill add-background-job-emmanuelkwaa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-background-job
Source: https://github.com/Emmanuelkwaa/NetRockTemplate/tree/main/.claude/skills/add-background-job
Command: npx skills add https://github.com/Emmanuelkwaa/NetRockTemplate --skill add-background-job-emmanuelkwaa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows you to offload time-consuming or long-running operations from the main request pipeline, improving application responsiveness and user experience. It handles both recurring scheduled tasks and one-time background jobs.

Core Features & Use Cases

  • Recurring Jobs: Schedule tasks to run automatically at defined intervals (e.g., daily cleanup, hourly data sync).
  • One-Time Jobs: Enqueue immediate or delayed tasks for execution (e.g., sending emails, processing uploads).
  • Use Case: Automatically send a weekly digest email to users every Monday morning, or process a user-uploaded image in the background without making the user wait.

Quick Start

Add a recurring job named 'daily-report' that runs every day using the 'Daily()' cron expression.

Frequently Asked Questions about add-background-job

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule recurring background jobs in a .NET application?

Scheduling recurring background jobs in .NET involves implementing `IRecurringJobDefinition` interfaces to define intervals, enabling tasks like daily reports or hourly data syncs to execute automatically without blocking the main request pipeline.

How do I enqueue one-time background tasks for immediate execution?

You can enqueue one-time background tasks for immediate or delayed execution using `IBackgroundJobClient`, provided the job parameters are JSON-serializable, which allows operations like sending emails or processing uploads to run asynchronously.

Does Hangfire background job execution support dependency injection?

Hangfire background job execution integrates directly with .NET dependency injection, allowing jobs to resolve scoped services automatically and execute long-running operations without degrading application responsiveness.

What are the parameter requirements for enqueuing jobs with IBackgroundJobClient?

Enqueuing jobs with `IBackgroundJobClient` requires method parameters to be JSON-serializable, ensuring the arguments can be correctly persisted and deserialized when the background job is eventually executed by the worker.

Why offload long-running operations to background tasks?

Offloading long-running operations to background tasks improves application responsiveness and user experience by moving time-consuming work, such as image processing, out of the main request pipeline so users do not have to wait.