Sparkdo.Hangfire 1.0.2

dotnet add package Sparkdo.Hangfire --version 1.0.2
                    
NuGet\Install-Package Sparkdo.Hangfire -Version 1.0.2
                    
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="Sparkdo.Hangfire" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Hangfire" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.Hangfire" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sparkdo.Hangfire --version 1.0.2
                    
#r "nuget: Sparkdo.Hangfire, 1.0.2"
                    
#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.
#:package Sparkdo.Hangfire@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sparkdo.Hangfire&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.Hangfire&version=1.0.2
                    
Install as a Cake Tool

Sparkdo.Hangfire

Sparkdo Hangfire 集成库,提供后台作业调度功能实现。

功能特性

  • Hangfire 后台作业服务器集成
  • 支持多租户环境下的作业调度
  • 权限控制的 Hangfire Dashboard
  • 可配置的队列前缀支持
  • 与 Sparkdo 框架无缝集成

安装

<PackageReference Include="Sparkdo.Hangfire" Version="x.x.x" />

核心组件

SparkdoHangfireModule

Hangfire 模块配置,负责初始化和配置 Hangfire 服务:

  • 注册 Hangfire 服务
  • 配置后台作业服务器
  • 管理作业服务器生命周期

SparkdoHangfireOptions

Hangfire 配置选项,允许自定义 Hangfire 行为:

  • DefaultQueuePrefix: 队列名称前缀
  • MaxQueueNameLength: 队列名称最大长度
  • DefaultQueue: 默认队列名称
  • ServerOptions: 后台作业服务器选项
  • AdditionalProcesses: 附加后台进程
  • Storage: 作业存储配置
  • BackgroundJobServerFactory: 后台作业服务器工厂

SparkdoHangfireAuthorizationFilter

Hangfire Dashboard 授权过滤器,提供基于权限的访问控制:

  • 支持始终允许访问配置
  • 支持多租户环境控制
  • 基于角色和权限的访问控制

SparkdoHangfireBackgroundJobServer

Hangfire 后台作业服务器包装器:

  • 封装 Hangfire 后台作业服务器实例
  • 提供服务器生命周期管理

SparkdoHangfireOptionsConfiguration

Hangfire 选项后配置,负责验证和配置队列名称:

  • 验证队列前缀格式
  • 应用队列前缀到服务器选项
  • 验证队列名称长度限制

扩展性

该库提供了完整的 Hangfire 集成功能实现,可以通过以下方式扩展:

  1. 自定义 SparkdoHangfireOptions.BackgroundJobServerFactory 来创建自定义的后台作业服务器
  2. 实现自定义的 IBackgroundProcess 来添加特定的后台进程
  3. 通过 SparkdoHangfireOptions 配置 Hangfire 行为
  4. 使用 SparkdoHangfireAuthorizationFilter 自定义 Dashboard 访问控制策略

代码结构说明

本项目包含以下主要组件:

模块配置

  • SparkdoHangfireModule: Hangfire 模块配置

配置选项

  • SparkdoHangfireOptions: Hangfire 配置选项
  • SparkdoHangfireOptionsConfiguration: Hangfire 选项后配置

授权过滤器

  • SparkdoHangfireAuthorizationFilter: Hangfire Dashboard 授权过滤器

服务器管理

  • SparkdoHangfireBackgroundJobServer: Hangfire 后台作业服务器包装器

所有公共接口和类都添加了详细的 XML 文档注释,便于开发者理解和使用。

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Sparkdo.Hangfire:

Package Downloads
Sparkdo.BackgroundWorkers.Hangfire

Sparkdo Hangfire 后台工作者库,提供基于 Hangfire 的后台工作者功能集成实现

Sparkdo.BackgroundJobs.Hangfire

Sparkdo Hangfire 后台作业库,提供基于 Hangfire 的后台作业功能集成实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 117 4/27/2026
1.0.2-preview.5 56 4/15/2026
1.0.2-preview.4 76 2/8/2026
1.0.2-preview.3 71 2/1/2026
1.0.2-preview.2 67 1/31/2026
1.0.2-preview.1 166 12/4/2025
1.0.1 320 11/27/2025
1.0.0 305 11/25/2025
1.0.0-preview.5 136 10/24/2025