Share via


IHostedLifecycleService Schnittstelle

Definition

Definiert Methoden, die vor oder nach StartAsync(CancellationToken) und StopAsync(CancellationToken)ausgeführt werden.

public interface class IHostedLifecycleService : Microsoft::Extensions::Hosting::IHostedService
public interface IHostedLifecycleService : Microsoft.Extensions.Hosting.IHostedService
type IHostedLifecycleService = interface
    interface IHostedService
Public Interface IHostedLifecycleService
Implements IHostedService
Implementiert

Methoden

StartAsync(CancellationToken)

Wird ausgelöst, wenn der Anwendungshost bereit ist, den Dienst zu starten.

(Geerbt von IHostedService)
StartedAsync(CancellationToken)

Wird nach StartAsync(CancellationToken)ausgelöst.

StartingAsync(CancellationToken)

Wird vor StartAsync(CancellationToken)ausgelöst.

StopAsync(CancellationToken)

Wird ausgelöst, wenn der Anwendungshost ein ordnungsgemäßes Herunterfahren ausführt.

(Geerbt von IHostedService)
StoppedAsync(CancellationToken)

Wird nach StopAsync(CancellationToken)ausgelöst.

StoppingAsync(CancellationToken)

Wird vor StopAsync(CancellationToken)ausgelöst.

Erweiterungsmethoden

StartAndStopAsync(IHostedService, CancellationToken)

Startet den Dienst und beendet den Dienst sofort.

Gilt für: