Share via


ApplicationLifetime Class

Definition

Allows consumers to perform cleanup during a graceful shutdown.

public ref class ApplicationLifetime : Microsoft::Extensions::Hosting::IApplicationLifetime, Microsoft::Extensions::Hosting::IHostApplicationLifetime
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
ApplicationLifetime
Implements

Remarks

This API supports the .NET infrastructure and is not intended to be used directly from your code.

Constructors

ApplicationLifetime(ILogger<ApplicationLifetime>)

Initializes an ApplicationLifetime instance using the specified logger.

Properties

ApplicationStarted

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

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

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

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
NotifyStarted()

Signals the ApplicationStarted event and blocks until it completes.

NotifyStopped()

Signals the ApplicationStopped event and blocks until it completes.

StopApplication()

Signals the ApplicationStopping event and blocks until it completes.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to