IHostedLifecycleService Interface
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Définit les méthodes exécutées avant ou après StartAsync(CancellationToken) et StopAsync(CancellationToken).
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
- Implémente
Méthodes
StartAsync(CancellationToken) |
Déclenché quand l’hôte d’application est prêt à démarrer le service. (Hérité de IHostedService) |
StartedAsync(CancellationToken) |
Déclenché après StartAsync(CancellationToken). |
StartingAsync(CancellationToken) |
Déclenchée avant StartAsync(CancellationToken). |
StopAsync(CancellationToken) |
Déclenché quand l’hôte d’application effectue un arrêt normal. (Hérité de IHostedService) |
StoppedAsync(CancellationToken) |
Déclenché après StopAsync(CancellationToken). |
StoppingAsync(CancellationToken) |
Déclenchée avant StopAsync(CancellationToken). |
Méthodes d’extension
StartAndStopAsync(IHostedService, CancellationToken) |
Démarre et arrête immédiatement le service. |
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour