BackgroundJobClient Class |
Namespace: Hangfire
The BackgroundJobClient type exposes the following members.
Name | Description | |
---|---|---|
BackgroundJobClient |
Initializes a new instance of the BackgroundJobClient
class with the storage from a global configuration.
| |
BackgroundJobClient(JobStorage) |
Initializes a new instance of the BackgroundJobClient
class with the specified storage.
| |
BackgroundJobClient(JobStorage, IBackgroundJobFactory, IBackgroundJobStateChanger) |
Initializes a new instance of the BackgroundJobClient class
with the specified storage, background job factory and state changer.
|
Name | Description | |
---|---|---|
ChangeState |
Attempts to change a state of a background job with a given
identifier to a specified one.
| |
Create |
Creates a new background job in a specified state.
|
Name | Description | |
---|---|---|
ChangeState |
Changes state of a job with the given jobId to
the specified one.
(Defined by BackgroundJobClientExtensions.) | |
ContinueWith(String, ExpressionAction) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWith(String, ExpressionAction, IState) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWith(String, ExpressionAction, JobContinuationOptions) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWith(String, ExpressionAction, IState, JobContinuationOptions) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWithT(String, ExpressionActionT) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWithT(String, ExpressionActionT, IState) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWithT(String, ExpressionActionT, JobContinuationOptions) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
ContinueWithT(String, ExpressionActionT, IState, JobContinuationOptions) | Overloaded. (Defined by BackgroundJobClientExtensions.) | |
Create(ExpressionAction, IState) | Overloaded.
Creates a new background job based on a specified static method
within a given state.
(Defined by BackgroundJobClientExtensions.) | |
CreateT(ExpressionActionT, IState) | Overloaded.
Creates a new background job based on a specified instance method
within a given state.
(Defined by BackgroundJobClientExtensions.) | |
Delete(String) | Overloaded.
Changes state of a job with the specified jobId
to the DeletedState.
(Defined by BackgroundJobClientExtensions.) | |
Delete(String, String) | Overloaded.
Changes state of a job with the specified jobId
to the DeletedState. 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.
(Defined by BackgroundJobClientExtensions.) | |
Enqueue(ExpressionAction) | Overloaded.
Creates a background job based on a specified static method
call expression and places it into its actual queue.
Please, see the QueueAttribute to learn how to
place the job on a non-default queue.
(Defined by BackgroundJobClientExtensions.) | |
EnqueueT(ExpressionActionT) | Overloaded.
Creates a background job based on a specified instance method
call expression and places it into its actual queue.
Please, see the QueueAttribute to learn how to
place the job on a non-default queue.
(Defined by BackgroundJobClientExtensions.) | |
Requeue(String) | Overloaded.
Changes state of a job with the specified jobId
to the EnqueuedState.
(Defined by BackgroundJobClientExtensions.) | |
Requeue(String, String) | Overloaded.
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.
(Defined by BackgroundJobClientExtensions.) | |
Schedule(ExpressionAction, TimeSpan) | Overloaded.
Creates a new background job based on a specified static method
call expression and schedules it to be enqueued after a given delay.
(Defined by BackgroundJobClientExtensions.) | |
Schedule(ExpressionAction, DateTimeOffset) | Overloaded.
Creates a new background job based on a specified method call expression
and schedules it to be enqueued at the specified moment of time.
(Defined by BackgroundJobClientExtensions.) | |
ScheduleT(ExpressionActionT, TimeSpan) | Overloaded.
Creates a new background job based on a specified instance method
call expression and schedules it to be enqueued after a given delay.
(Defined by BackgroundJobClientExtensions.) | |
ScheduleT(ExpressionActionT, DateTimeOffset) | Overloaded.
Creates a new background job based on a specified method expression and schedules
it to be enqueued at the specified moment.
(Defined by BackgroundJobClientExtensions.) |
This class uses the IBackgroundJobFactory interface for creating background jobs and the IBackgroundJobStateChanger interface for changing their states. Please see documentation for those types and their implementations to learn the details.
Caution |
---|
Despite the fact that instance methods of this class are thread-safe, most implementations of the IState interface are neither thread-safe, nor immutable. Please create a new instance of a state class for each operation to avoid race conditions and unexpected side effects. |