IHostedLifecycleService Interface

Définition

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 à