Table of Contents

Class TerminalHostedService

Namespace
OneImlx.Terminal.Hosting
Assembly
OneImlx.Terminal.dll

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

public abstract class TerminalHostedService : IHostedService
Inheritance
TerminalHostedService
Implements
Inherited Members

Constructors

TerminalHostedService(IServiceProvider, IOptions<TerminalOptions>, ITerminalConsole, ITerminalExceptionHandler, ILogger<TerminalHostedService>)

Initializes a new instance.

public TerminalHostedService(IServiceProvider serviceProvider, IOptions<TerminalOptions> terminalOptions, ITerminalConsole terminalConsole, ITerminalExceptionHandler terminalExceptionHandler, ILogger<TerminalHostedService> logger)

Parameters

serviceProvider IServiceProvider

The service provider.

terminalOptions IOptions<TerminalOptions>

The configuration options.

terminalConsole ITerminalConsole

The terminal console.

terminalExceptionHandler ITerminalExceptionHandler

The exception handler.

logger ILogger<TerminalHostedService>

The logger.

Properties

Options

The terminal configuration options.

protected IOptions<TerminalOptions> Options { get; }

Property Value

IOptions<TerminalOptions>

ServiceProvider

The service provider.

protected IServiceProvider ServiceProvider { get; }

Property Value

IServiceProvider

TerminalConsole

The terminal console.

protected ITerminalConsole TerminalConsole { get; }

Property Value

ITerminalConsole

Methods

ConfigureLifetimeAsync()

Configures the application's lifetime with IHostApplicationLifetime.

protected abstract Task ConfigureLifetimeAsync()

Returns

Task

StartAsync(CancellationToken)

Starts the hosted service asynchronously.

public Task StartAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task

StopAsync(CancellationToken)

Stops the hosted service asynchronously.

public Task StopAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task