DelayedJobScheduler Class |
Namespace: Hangfire.Server
The DelayedJobScheduler type exposes the following members.
Name | Description | |
---|---|---|
DelayedJobScheduler |
Initializes a new instance of the DelayedJobScheduler
class with the DefaultPollingDelay value as a
delay between runs.
| |
DelayedJobScheduler(TimeSpan) |
Initializes a new instance of the DelayedJobScheduler
class with a specified polling interval.
| |
DelayedJobScheduler(TimeSpan, IBackgroundJobStateChanger) |
Initializes a new instance of the DelayedJobScheduler
class with a specified polling interval and given state changer.
|
Name | Description | |
---|---|---|
Execute | ||
ToString | Returns a string that represents the current object. (Overrides ObjectToString.) |
Name | Description | |
---|---|---|
DefaultPollingDelay |
Represents a default polling interval for delayed job scheduler.
This field is read-only.
|
This background process polls the delayed job schedule for delayed jobs that are ready to be enqueued. To prevent a stress load on a job storage, the configurable delay is used between scheduler runs. Delay is used only when there are no more background jobs to be enqueued.
When a background job is ready to be enqueued, it is simply moved from ScheduledState to the EnqueuedState by using IBackgroundJobStateChanger.
Delayed job schedule is based on a Set data structure 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.
Important |
---|
If you are using custom filter providers, you need to pass a custom IBackgroundJobStateChanger instance to make this process respect your filters when enqueueing background jobs. |