Search Results for

    Show / Hide Table of Contents
    View Source

    Class AsyncComponentBase

    Represents a component.

    Inheritance
    System.Object
    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.

    Methods

    View Source

    CanExecute(Boolean)

    Determines whether the component can execute.

    Declaration
    protected virtual bool CanExecute(bool isRestarting)
    Parameters
    Type Name Description
    System.Boolean isRestarting

    If set to true indicates Umbraco is restarting.

    Returns
    Type Description
    System.Boolean

    true if the component can execute; otherwise, false.

    View Source

    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 representing the asynchronous operation.

    View Source

    InitializeAsync(Boolean, CancellationToken)

    Initializes the component.

    Declaration
    public async Task InitializeAsync(bool isRestarting, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Boolean isRestarting

    If set to true indicates Umbraco is restarting.

    CancellationToken cancellationToken

    The cancellation token. Cancellation indicates that the start process has been aborted.

    Returns
    Type Description
    Task

    A representing the asynchronous operation.

    View Source

    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 representing the asynchronous operation.

    View Source

    TerminateAsync(Boolean, CancellationToken)

    Terminates the component.

    Declaration
    public async Task TerminateAsync(bool isRestarting, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Boolean isRestarting

    If set to true indicates Umbraco is restarting.

    CancellationToken cancellationToken

    The cancellation token. Cancellation indicates that the shutdown process should no longer be graceful.

    Returns
    Type Description
    Task

    A representing the asynchronous operation.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • CanExecute(Boolean)
      • InitializeAsync(CancellationToken)
      • InitializeAsync(Boolean, CancellationToken)
      • TerminateAsync(CancellationToken)
      • TerminateAsync(Boolean, CancellationToken)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX