Click or drag to resize
BackgroundJob Class
Provides static methods for creating fire-and-forget, delayed jobs and continuations as well as re-queue and delete existing background jobs.
Inheritance Hierarchy
SystemObject
  HangfireBackgroundJob

Namespace: Hangfire
Assembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax
public class BackgroundJob
Methods
  NameDescription
Public methodStatic memberContinueWith(String, ExpressionAction)
Public methodStatic memberContinueWith(String, ExpressionAction, JobContinuationOptions)
Public methodStatic memberContinueWithT(String, ExpressionActionT)
Public methodStatic memberContinueWithT(String, ExpressionActionT, JobContinuationOptions)
Public methodStatic memberDelete(String)
Changes state of a job with the specified jobId to the DeletedState.
Public methodStatic memberDelete(String, String)
Changes state of a job with the specified jobId to the DeletedState. State change is only performed if current job state is equal to the fromState value.
Public methodStatic memberEnqueue(ExpressionAction)
Creates a new fire-and-forget job based on a given method call expression.
Public methodStatic memberEnqueueT(ExpressionActionT)
Creates a new fire-and-forget job based on a given method call expression.
Public methodStatic memberRequeue(String)
Changes state of a job with the specified jobId to the EnqueuedState.
Public methodStatic memberRequeue(String, String)
Changes state of a job with the specified jobId to the EnqueuedState. If fromState value is not null, state change will be performed only if the current state name of a job equal to the given value.
Public methodStatic memberSchedule(ExpressionAction, DateTimeOffset)
Creates a new background job based on a specified method call expression and schedules it to be enqueued at the given moment of time.
Public methodStatic memberSchedule(ExpressionAction, TimeSpan)
Creates a new background job based on a specified static method call expression and schedules it to be enqueued after a given delay.
Public methodStatic memberScheduleT(ExpressionActionT, DateTimeOffset)
Creates a new background job based on a specified method call expression and schedules it to be enqueued at the given moment of time.
Public methodStatic memberScheduleT(ExpressionActionT, TimeSpan)
Creates a new background job based on a specified instance method call expression and schedules it to be enqueued after a given delay.
Top
Remarks

This class is a wrapper for the IBackgroundJobClient interface and its default implementation, BackgroundJobClient class, that was created for the most simple scenarios. Please consider using the types above in real world applications.

This class also contains undocumented constructor and instance members. They are hidden to not to confuse new users. You can freely use them in low-level API.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also