ApplicationLifetime ApplicationLifetime ApplicationLifetime Class

Definition

Allows consumers to perform cleanup during a graceful shutdown.

public class ApplicationLifetime : Microsoft.Extensions.Hosting.IApplicationLifetime, Microsoft.Extensions.Hosting.IHostApplicationLifetime
type ApplicationLifetime = class
    interface IApplicationLifetime
    interface IHostApplicationLifetime
Public Class ApplicationLifetime
Implements IApplicationLifetime, IHostApplicationLifetime
Inheritance
ApplicationLifetimeApplicationLifetimeApplicationLifetime
Implements

Constructors

ApplicationLifetime(ILogger<ApplicationLifetime>) ApplicationLifetime(ILogger<ApplicationLifetime>) ApplicationLifetime(ILogger<ApplicationLifetime>)

Properties

ApplicationStarted ApplicationStarted ApplicationStarted

Triggered when the application host has fully started and is about to wait for a graceful shutdown.

ApplicationStopped ApplicationStopped ApplicationStopped

Triggered when the application host is performing a graceful shutdown. All requests should be complete at this point. Shutdown will block until this event completes.

ApplicationStopping ApplicationStopping ApplicationStopping

Triggered when the application host is performing a graceful shutdown. Request may still be in flight. Shutdown will block until this event completes.

Methods

NotifyStarted() NotifyStarted() NotifyStarted()

Signals the ApplicationStarted event and blocks until it completes.

NotifyStopped() NotifyStopped() NotifyStopped()

Signals the ApplicationStopped event and blocks until it completes.

StopApplication() StopApplication() StopApplication()

Signals the ApplicationStopping event and blocks until it completes.

Applies to