Job.Hangfire.CSRedis
1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Job.Hangfire.CSRedis --version 1.0.1
NuGet\Install-Package Job.Hangfire.CSRedis -Version 1.0.1
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="Job.Hangfire.CSRedis" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Job.Hangfire.CSRedis --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Job.Hangfire.CSRedis, 1.0.1"
#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.
// Install Job.Hangfire.CSRedis as a Cake Addin #addin nuget:?package=Job.Hangfire.CSRedis&version=1.0.1 // Install Job.Hangfire.CSRedis as a Cake Tool #tool nuget:?package=Job.Hangfire.CSRedis&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Hangfire.HttpJob.CSRedis
介绍
基于redis储存(csredis客户端)的hangfire扩展,可注册程序集内作业、http作业、可控远程作业
配置文件方式
{
//定时服务监听队列,只能小写;多个以英文逗号隔开,默认为default
"Queue": "default",
//存储使用redis,提高性能;redis通用连接字符串
"RedisConnection": "127.0.0.1:6379,defaultDatabase=5,poolsize=50",
//redis key前缀
"Prefix": "{hangfire}",
//异常后重试次数,默认3次
"Retry": 3,
//服务轮询时间间隔,单位秒,默认15秒
"SchedulePollingInterval": 15,
//成功作业过期时间,单位小时,默认10个小时,建议不能小于1小时
"SuccedExpireTime": 8,
//到期时间检查间隔,单位分钟,默认30分钟
"ExpiryCheckInterval": 30,
//拉取超时时间,单位分钟,默认3分钟
"FetchTimeout": 3,
//服务实例超时时间,单位分钟,过期移除,默认2分钟
"ServerTimeout": 2,
//服务实例检测时间间隔,单位分钟,默认2分钟
"ServerCheckInterval": 2,
//http job列表(http方式调用)
"HttpJobList": [
{
//唯一作业名称,不能重复
"JobName": "",
//作业所属队列,默认default
"Queue": "default",
//自定义参数,key-value只能是字符串;{ "key1": "value1" }
"JobData": {},
//实际调用接口服务地址,以http|https开头
"Url": "",
//接口请求方式:POST,GET; POST请求时,使用application/json
"HttpMethod": "GET",
//请求header,key-value只能是字符串,{ "key1": "value1" }
"Header": {},
//任务类型:1一次性任务,2周期循环任务
"TaskType": 1,
//任务执行延时秒数,小于等于0立即调度执行; 一次性任务有效
"Second": 0,
//务执行cron表达式;周期循环任务有效
"Cron": ""
}
],
"AgentJobList": [
{
//唯一作业名称,不能重复
"JobName": "",
//作业所属队列,默认default
"Queue": "default",
//任务类型:1一次性任务,2周期循环任务
"TaskType": 1,
//任务执行延时秒数,小于等于0立即调度执行; 一次性任务有效
"Second": 0,
//务执行cron表达式;周期循环任务有效
"Cron": "",
//hangfire任务服务回调url,比如:http://localhost:5000/hangfire_redis_callback
"ServerUrl": "",
//实际任务执行服务url,比如:http://localhost:5000/hangfire_agent
"AgentUrl": "",
//自定义参数,key-value只能是字符串,{ "key1": "value1" }
"JobData": {}
}
]
}
使用说明
var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureAppConfiguration((host, config) =>
{
});
builder.Services.AddHangfireRedis(builder.Configuration);
var app = builder.Build();
app.UseHanfgireRedis();
更多使用方式,请看DEMO
Product | Versions 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | 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.
-
.NETStandard 2.1
- CSRedisCore (>= 3.8.670)
- Hangfire.AspNetCore (>= 1.7.34)
- Hangfire.Redis.CSRedisCore (>= 0.0.2)
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.Extensions.Hosting (>= 7.0.1)
- Microsoft.Extensions.Http (>= 7.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.