IHostedLifecycleService Schnittstelle
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Definiert Methoden, die vor oder nach und StopAsync(CancellationToken)nach StartAsync(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
| Name | Beschreibung |
|---|---|
| StartAsync(CancellationToken) |
Wird ausgelöst, wenn der Anwendungshost bereit ist, den Dienst zu starten. (Geerbt von IHostedService) |
| StartedAsync(CancellationToken) |
Ausgelöst nach StartAsync(CancellationToken). |
| StartingAsync(CancellationToken) |
Ausgelöst vor StartAsync(CancellationToken). |
| StopAsync(CancellationToken) |
Wird ausgelöst, wenn der Anwendungshost ein ordnungsgemäßes Herunterfahren durchführt. (Geerbt von IHostedService) |
| StoppedAsync(CancellationToken) |
Ausgelöst nach StopAsync(CancellationToken). |
| StoppingAsync(CancellationToken) |
Ausgelöst vor StopAsync(CancellationToken). |
Erweiterungsmethoden
| Name | Beschreibung |
|---|---|
| StartAndStopAsync(IHostedService, CancellationToken) |
Startet den Dienst und beendet den Dienst sofort. |