Sparkdo.Hangfire 1.0.0-preview.5

This is a prerelease version of Sparkdo.Hangfire.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Sparkdo.Hangfire --version 1.0.0-preview.5
                    
NuGet\Install-Package Sparkdo.Hangfire -Version 1.0.0-preview.5
                    
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.0-preview.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Hangfire" Version="1.0.0-preview.5" />
                    
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.0-preview.5
                    
#r "nuget: Sparkdo.Hangfire, 1.0.0-preview.5"
                    
#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.0-preview.5
                    
#: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.0-preview.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.Hangfire&version=1.0.0-preview.5&prerelease
                    
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 net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.BackgroundJobs.Hangfire

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

Sparkdo.BackgroundWorkers.Hangfire

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2-preview.1 133 12/4/2025
1.0.1 251 11/27/2025
1.0.0 249 11/25/2025
1.0.0-preview.5 93 10/24/2025