RepletoryLib.BackgroundJobs.Hangfire
1.0.0
dotnet add package RepletoryLib.BackgroundJobs.Hangfire --version 1.0.0
NuGet\Install-Package RepletoryLib.BackgroundJobs.Hangfire -Version 1.0.0
<PackageReference Include="RepletoryLib.BackgroundJobs.Hangfire" Version="1.0.0" />
<PackageVersion Include="RepletoryLib.BackgroundJobs.Hangfire" Version="1.0.0" />
<PackageReference Include="RepletoryLib.BackgroundJobs.Hangfire" />
paket add RepletoryLib.BackgroundJobs.Hangfire --version 1.0.0
#r "nuget: RepletoryLib.BackgroundJobs.Hangfire, 1.0.0"
#:package RepletoryLib.BackgroundJobs.Hangfire@1.0.0
#addin nuget:?package=RepletoryLib.BackgroundJobs.Hangfire&version=1.0.0
#tool nuget:?package=RepletoryLib.BackgroundJobs.Hangfire&version=1.0.0
RepletoryLib.BackgroundJobs.Hangfire
Hangfire implementation of IBackgroundJobService with dashboard, storage options, and logging filters.
Part of the RepletoryLib ecosystem -- standalone, reusable .NET 10 libraries with zero business logic.
Overview
RepletoryLib.BackgroundJobs.Hangfire implements IBackgroundJobService from RepletoryLib.BackgroundJobs.Abstractions using Hangfire. It supports fire-and-forget, scheduled, and recurring jobs with SQL Server or in-memory storage, a built-in dashboard, and logging filters.
Key Features
- Fire-and-forget -- Enqueue jobs for immediate background execution
- Scheduled jobs -- Execute after a specified delay
- Recurring jobs -- Cron-based scheduling with add/update/remove
- Dashboard -- Built-in web UI for monitoring jobs
- Storage options -- SQL Server persistence or in-memory (development)
- Logging filter -- Automatic logging of job lifecycle events
Installation
dotnet add package RepletoryLib.BackgroundJobs.Hangfire
Dependencies
| Package | Type |
|---|---|
RepletoryLib.BackgroundJobs.Abstractions |
RepletoryLib |
Hangfire.Core |
NuGet (1.8.18) |
Hangfire.AspNetCore |
NuGet |
Hangfire.SqlServer |
NuGet |
Hangfire.InMemory |
NuGet |
Quick Start
using RepletoryLib.BackgroundJobs.Hangfire;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRepletoryHangfire(builder.Configuration);
var app = builder.Build();
app.UseRepletoryHangfire(); // Enables dashboard
{
"Hangfire": {
"StorageType": "SqlServer",
"ConnectionString": "Server=localhost,1433;Database=MyApp;User Id=sa;Password=Repletory@123!;TrustServerCertificate=true",
"WorkerCount": 4,
"EnableDashboard": true,
"DashboardPath": "/hangfire",
"DashboardRequireAuth": true
}
}
Configuration
HangfireOptions
| Property | Type | Default | Description |
|---|---|---|---|
StorageType |
HangfireStorageType |
InMemory |
SqlServer or InMemory |
ConnectionString |
string? |
null |
SQL Server connection (required for SqlServer) |
WorkerCount |
int |
CPU count | Number of background worker threads |
EnableDashboard |
bool |
true |
Enable Hangfire dashboard UI |
DashboardPath |
string |
"/hangfire" |
Dashboard URL path |
DashboardRequireAuth |
bool |
true |
Require authentication for dashboard |
Usage Examples
Fire-and-Forget
using RepletoryLib.BackgroundJobs.Abstractions.Interfaces;
await _jobs.EnqueueAsync(() => _emailService.SendWelcomeEmailAsync(userId));
Scheduled Jobs
await _jobs.ScheduleAsync(
() => _reminderService.SendReminderAsync(orderId),
TimeSpan.FromHours(24));
Recurring Jobs
// Daily at 6 AM
await _jobs.AddOrUpdateRecurringAsync("daily-report",
() => _reportService.GenerateDailyAsync(), "0 6 * * *");
// Remove
await _jobs.RemoveRecurringAsync("daily-report");
Integration with Other RepletoryLib Packages
| Package | Relationship |
|---|---|
RepletoryLib.BackgroundJobs.Abstractions |
Implements IBackgroundJobService |
RepletoryLib.Workers |
Alternative for long-running polling/queue workers |
RepletoryLib.Logging |
Job lifecycle logged via Serilog |
RepletoryLib.HealthChecks |
Monitor Hangfire storage health |
License
This project is licensed under the MIT License.
Copyright (c) 2024-2026 Repletory.
For complete documentation, infrastructure setup, and configuration reference, see the RepletoryLib main repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Hangfire.AspNetCore (>= 1.8.18)
- Hangfire.Core (>= 1.8.18)
- Hangfire.InMemory (>= 1.0.0)
- Hangfire.SqlServer (>= 1.8.18)
- RepletoryLib.BackgroundJobs.Abstractions (>= 1.0.0)
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.0 | 62 | 3/2/2026 |