ApplicationLifetime Klass

Definition

Gör det möjligt för konsumenter att utföra rensning under en graciös avstängning.

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
Arv
ApplicationLifetime
Implementeringar

Kommentarer

Det här API:et stöder .NET infrastruktur och är inte avsett att användas direkt från koden.

Konstruktorer

Name Description
ApplicationLifetime(ILogger<ApplicationLifetime>)

Initierar en ApplicationLifetime instans med den angivna loggaren.

Egenskaper

Name Description
ApplicationStarted

Hämtar en annulleringstoken. Utlöses när programvärden har startats helt och väntar på en korrekt avstängning.

ApplicationStopped

Hämtar en annulleringstoken. Utlöses när programvärden utför en graciös avstängning. Alla begäranden ska vara slutförda just nu. Avstängningen blockeras tills den här händelsen har slutförts.

ApplicationStopping

Hämtar en annulleringstoken. Utlöses när programvärden utför en graciös avstängning. Begäran kan fortfarande vara under flygning. Avstängningen blockeras tills den här händelsen har slutförts.

Metoder

Name Description
NotifyStarted()

Utlöses ApplicationStarted och blockeras tills den har slutförts.

NotifyStopped()

Utlöses ApplicationStopped och blockeras tills den har slutförts.

StopApplication()

Utlöses ApplicationStopping och blockeras tills den har slutförts.

Gäller för