Langage

IHostedLifecycleService Interface

Définition

Définit les méthodes qui sont 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

Nom Description
StartAsync(CancellationToken)

Déclenché lorsque l’hôte de l’application est prêt à démarrer le service.

(Hérité de IHostedService)
StartedAsync(CancellationToken)

Déclenché après StartAsync(CancellationToken).

StartingAsync(CancellationToken)

Déclenché avant StartAsync(CancellationToken).

StopAsync(CancellationToken)

Déclenché lorsque l’hôte de l’application effectue un arrêt approprié.

(Hérité de IHostedService)
StoppedAsync(CancellationToken)

Déclenché après StopAsync(CancellationToken).

StoppingAsync(CancellationToken)

Déclenché avant StopAsync(CancellationToken).

Méthodes d’extension

Nom Description
StartAndStopAsync(IHostedService, CancellationToken)

Démarre et arrête immédiatement le service.

S’applique à