Interface IBackgroundTask
Represents a background task.
Namespace: Umbraco.Web.Scheduling
Assembly: Umbraco.Web.dll
Syntax
public interface IBackgroundTask : IDisposable
Properties
View SourceIsAsync
Indicates whether the background task can run asynchronously.
Declaration
bool IsAsync { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
View SourceRun()
Runs the background task.
Declaration
void Run()
RunAsync(CancellationToken)
Runs the task asynchronously.
Declaration
Task RunAsync(CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | token | A cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task instance representing the execution of the background task. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | The background task cannot run asynchronously. |