Table of Contents

Class HangfireJobRegistrationService

Namespace
KadicErp.WebApi.Services
Assembly
KadicErp.WebApi.dll
public sealed class HangfireJobRegistrationService : BackgroundService
Inheritance
object
BackgroundService
HangfireJobRegistrationService

Constructors

HangfireJobRegistrationService(IOptions<HangfireJobsSettings>, IServiceScopeFactory, IWorkerSchedulerService, ILogger<HangfireJobRegistrationService>)

public HangfireJobRegistrationService(IOptions<HangfireJobsSettings> settings, IServiceScopeFactory scopeFactory, IWorkerSchedulerService workerScheduler, ILogger<HangfireJobRegistrationService> logger)

Parameters

settings IOptions<HangfireJobsSettings>
scopeFactory IServiceScopeFactory
workerScheduler IWorkerSchedulerService
logger ILogger<HangfireJobRegistrationService>

Methods

ExecuteAsync(CancellationToken)

This method is called when the Microsoft.Extensions.Hosting.IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.

protected override Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Triggered when Microsoft.Extensions.Hosting.IHostedService.StopAsync(System.Threading.CancellationToken) is called.

Returns

Task

A System.Threading.Tasks.Task that represents the long running operations.

Remarks

See Worker Services in .NET for implementation guidelines.