Class AsyncComponentBase
Inheritance
Namespace: Umbraco.Cms.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
public abstract class AsyncComponentBase : IAsyncComponent
Remarks
By default, the component will not execute if Umbraco is restarting.
Constructors
View SourceAsyncComponentBase()
Declaration
protected AsyncComponentBase()
Methods
View SourceCanExecute(bool)
Determines whether the component can execute.
Declaration
protected virtual bool CanExecute(bool isRestarting)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isRestarting | If set to |
Returns
| Type | Description |
|---|---|
| bool |
|
InitializeAsync(bool, CancellationToken)
Initializes the component.
Declaration
public Task InitializeAsync(bool isRestarting, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isRestarting | If set to |
| CancellationToken | cancellationToken | The cancellation token. Cancellation indicates that the start process has been aborted. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
InitializeAsync(CancellationToken)
Initializes the component.
Declaration
protected abstract Task InitializeAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The cancellation token. Cancellation indicates that the start process has been aborted. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
TerminateAsync(bool, CancellationToken)
Terminates the component.
Declaration
public Task TerminateAsync(bool isRestarting, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isRestarting | If set to |
| CancellationToken | cancellationToken | The cancellation token. Cancellation indicates that the shutdown process should no longer be graceful. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
TerminateAsync(CancellationToken)
Terminates the component.
Declaration
protected virtual Task TerminateAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The cancellation token. Cancellation indicates that the shutdown process should no longer be graceful. |
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing the asynchronous operation. |