Search Results for

    Show / Hide Table of Contents

    Class CliHostedService

    The pi-cli hosted service to manage the application lifetime and terminal customization.

    Inheritance
    Object
    CliHostedService
    Implements
    IHostedService
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: PerpetualIntelligence.Cli.Integration
    Assembly: PerpetualIntelligence.Cli.dll
    Syntax
    public class CliHostedService : IHostedService

    Constructors

    | Improve this Doc View Source

    CliHostedService(IServiceProvider, CliOptions, ILogger<CliHostedService>)

    Initializes a new instance.

    Declaration
    public CliHostedService(IServiceProvider serviceProvider, CliOptions cliOptions, ILogger<CliHostedService> logger)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The service provider.

    CliOptions cliOptions

    The configuration options.

    ILogger<CliHostedService> logger

    The logger.

    Methods

    | Improve this Doc View Source

    CheckHostApplicationConfigurationAsync(CliOptions)

    Allows the host application to perform additional configuration option checks.

    Declaration
    protected virtual Task CheckHostApplicationConfigurationAsync(CliOptions options)
    Parameters
    Type Name Description
    CliOptions options
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    OnStarted()

    Triggered when the pi-cli application host has fully started.

    Declaration
    protected virtual void OnStarted()
    | Improve this Doc View Source

    OnStopped()

    Triggered when the pi-cli application host has completed a graceful shutdown. The application will not exit until all callbacks registered on this token have completed.

    Declaration
    protected virtual void OnStopped()
    | Improve this Doc View Source

    OnStopping()

    Triggered when the pi-cli application host is starting a graceful shutdown. Shutdown will block until all callbacks registered on this token have completed.

    Declaration
    protected virtual void OnStopping()
    | Improve this Doc View Source

    PrintHostApplicationHeaderAsync()

    Allows the host application to print the custom header.

    Declaration
    protected virtual Task PrintHostApplicationHeaderAsync()
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    PrintHostApplicationLicensingAsync(License)

    Allows host application to print custom licensing information.

    Declaration
    protected virtual Task PrintHostApplicationLicensingAsync(License license)
    Parameters
    Type Name Description
    License license
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    RegisterHostApplicationEventsAsync(IHostApplicationLifetime)

    Allows the application to register its custom IHostApplicationLifetime events.

    Declaration
    protected virtual Task RegisterHostApplicationEventsAsync(IHostApplicationLifetime hostApplicationLifetime)
    Parameters
    Type Name Description
    IHostApplicationLifetime hostApplicationLifetime
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    StartAsync(CancellationToken)

    Starts the pi-cli hosted service asynchronously.

    Declaration
    public async Task StartAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task
    | Improve this Doc View Source

    StopAsync(CancellationToken)

    Stops the pi-cli hosted service asynchronously.

    Declaration
    public Task StopAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task

    Implements

    Microsoft.Extensions.Hosting.IHostedService
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright 2021 (c) Perpetual Intelligence L.L.C. All Rights Reserved