C# Class Hangfire.Server.RecurringJobScheduler

Represents a background process responsible for enqueueing recurring jobs.

This background process polls the recurring job schedule for recurring jobs ready to be enqueued. Interval between scheduler polls is hard-coded to 1 minute as a compromise between frequency and additional stress on job storage.

Use custom background processes if you need to schedule recurring jobs with frequency less than one minute. Please see the IBackgroundProcess interface for details.

Recurring job schedule is based on Set and Hash data structures of a job storage, so you can use this background process as an example of a custom extension.

Multiple instances of this background process can be used in separate threads/processes without additional configuration (distributed locks are used). However, this only adds support for fail-over, and does not increase the performance.

If you are using custom filter providers, you need to pass a custom IBackgroundJobFactory instance to make this process respect your filters when enqueueing background jobs.
Inheritance: IBackgroundProcess
显示文件 Open project: jcoutch/Hangfire

Public Methods

Method Description
Execute ( Hangfire.Server.BackgroundProcessContext context ) : void
RecurringJobScheduler ( ) : System

Initializes a new instance of the RecurringJobScheduler class with default background job factory.

RecurringJobScheduler ( [ factory ) : System

Initializes a new instance of the RecurringJobScheduler class with custom background job factory.

ToString ( ) : string

Private Methods

Method Description
RecurringJobScheduler ( [ factory, [ instantFactory, [ throttler ) : System
TryScheduleJob ( JobStorage storage, IStorageConnection connection, string recurringJobId, string>.IReadOnlyDictionary recurringJob ) : void

Method Details

Execute() public method

public Execute ( Hangfire.Server.BackgroundProcessContext context ) : void
context Hangfire.Server.BackgroundProcessContext
return void

RecurringJobScheduler() public method

Initializes a new instance of the RecurringJobScheduler class with default background job factory.
public RecurringJobScheduler ( ) : System
return System

RecurringJobScheduler() public method

Initializes a new instance of the RecurringJobScheduler class with custom background job factory.
is null.
public RecurringJobScheduler ( [ factory ) : System
factory [ Factory that will be used to create background jobs.
return System

ToString() public method

public ToString ( ) : string
return string