IHostedLifecycleService Gränssnitt

Definition

Definierar metoder som körs före eller efter StartAsync(CancellationToken) och 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
Implementeringar

Metoder

Name Description
StartAsync(CancellationToken)

Utlöses när programvärden är redo att starta tjänsten.

(Ärvd från IHostedService)
StartedAsync(CancellationToken)

Utlöses efter StartAsync(CancellationToken).

StartingAsync(CancellationToken)

Utlöses före StartAsync(CancellationToken).

StopAsync(CancellationToken)

Utlöses när programvärden utför en graciös avstängning.

(Ärvd från IHostedService)
StoppedAsync(CancellationToken)

Utlöses efter StopAsync(CancellationToken).

StoppingAsync(CancellationToken)

Utlöses före StopAsync(CancellationToken).

Tilläggsmetoder

Name Description
StartAndStopAsync(IHostedService, CancellationToken)

Startar och stoppar omedelbart tjänsten.

Gäller för