Chaunce.Hangfire.Client 1.0.0

This is a sdk for calling hangfire by remote
这是一个通过远程调用hangfire的sdk

Install-Package Chaunce.Hangfire.Client -Version 1.0.0
dotnet add package Chaunce.Hangfire.Client --version 1.0.0
<PackageReference Include="Chaunce.Hangfire.Client" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Chaunce.Hangfire.Client --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

:boom: Chaunce.Hangfire

Chaunce.Hangfire is a free, open source,Chaunce.Hangfire.Extension and Chaunce.Hangfire.Client built on the .NETStandard platform.
Chaunce.Hangfire.Extension fork from Hangfire.HttpJob!
 http://www.cnblogs.com/xiaoliangge/

About Chauce.Hangfire

Please visit our website at http://www.cnblogs.com/xiaoliangge/ for the most current information about this project.

Chaunce.Hangfire is free,open source.
Chaunce.Hangfire can be called by Java and go.
Now only provide C# sdk.

:boom: How to use

Step 1:appsettings.json

 "HangfireClientOptions": {
    "RecurringJobUrl": "hangfire/httpjob?op=recurringjob",
    "BackgroundJobUrl": "",
    "BaseUrl": "http://localhost:5000"
  }

Step 2 : ConfigureServices

public void ConfigureServices(IServiceCollection services)
        {
            var option = Configuration.GetSection(nameof(HangfireClientOptions)).Get<HangfireClientOptions>();

            services.AddHangfireClient(option);
        }

Step 3 : Write code in you controller


    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        private readonly IHangfireClient _hangfireClient;
        public ValuesController(IHangfireClient hangfireClient)
        {
            _hangfireClient = hangfireClient;
        }
        // GET api/values
        [HttpGet]
        public async Task<ActionResult<IEnumerable<string>>> Get()
        {
            var result = await _hangfireClient.SendTimerJobAsync(new HttpJobItem
            {
                Corn = Cron.MinuteInterval(10),
                Url = "https://blog.csdn.net/u014401141/article/details/71086757",
                JobName = "我是外部任务",
            }, TaskType.Recurringjob);
            return new string[] { "我成功了吗", $"{result}" };
        }
}

Step 4 :Get ready Chaunce.Hangfire.Server

First create database,databse name according to the appsettings.json's ConnectionStrings string
there is chauncehangfire

 "ConnectionStrings": {
    "HangfireConnection": "server=.;database=chauncehangfire;uid=sa;pwd=111111"
  },

Test Picture

:boom: Chaunce.Hangfire

Chaunce.Hangfire is a free, open source,Chaunce.Hangfire.Extension and Chaunce.Hangfire.Client built on the .NETStandard platform.
Chaunce.Hangfire.Extension fork from Hangfire.HttpJob!
 http://www.cnblogs.com/xiaoliangge/

About Chauce.Hangfire

Please visit our website at http://www.cnblogs.com/xiaoliangge/ for the most current information about this project.

Chaunce.Hangfire is free,open source.
Chaunce.Hangfire can be called by Java and go.
Now only provide C# sdk.

:boom: How to use

Step 1:appsettings.json

 "HangfireClientOptions": {
    "RecurringJobUrl": "hangfire/httpjob?op=recurringjob",
    "BackgroundJobUrl": "",
    "BaseUrl": "http://localhost:5000"
  }

Step 2 : ConfigureServices

public void ConfigureServices(IServiceCollection services)
        {
            var option = Configuration.GetSection(nameof(HangfireClientOptions)).Get<HangfireClientOptions>();

            services.AddHangfireClient(option);
        }

Step 3 : Write code in you controller


    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        private readonly IHangfireClient _hangfireClient;
        public ValuesController(IHangfireClient hangfireClient)
        {
            _hangfireClient = hangfireClient;
        }
        // GET api/values
        [HttpGet]
        public async Task<ActionResult<IEnumerable<string>>> Get()
        {
            var result = await _hangfireClient.SendTimerJobAsync(new HttpJobItem
            {
                Corn = Cron.MinuteInterval(10),
                Url = "https://blog.csdn.net/u014401141/article/details/71086757",
                JobName = "我是外部任务",
            }, TaskType.Recurringjob);
            return new string[] { "我成功了吗", $"{result}" };
        }
}

Step 4 :Get ready Chaunce.Hangfire.Server

First create database,databse name according to the appsettings.json's ConnectionStrings string
there is chauncehangfire

 "ConnectionStrings": {
    "HangfireConnection": "server=.;database=chauncehangfire;uid=sa;pwd=111111"
  },

Test Picture

Release Notes

此库配合https://github.com/liuyl1992/Chaunce.Hangfire/tree/master/src/Chaunce.Hangfire.Server使用
this library match https://github.com/liuyl1992/Chaunce.Hangfire/tree/master/src/Chaunce.Hangfire.Server to use

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 295 9/9/2018