WebHostExtensions.WaitForShutdownAsync(IWebHost, CancellationToken) Method

Definition

Returns a Task that completes when shutdown is triggered via the given token, Ctrl+C or SIGTERM.

C#
public static System.Threading.Tasks.Task WaitForShutdownAsync (this Microsoft.AspNetCore.Hosting.IWebHost host, System.Threading.CancellationToken token = default);

Parameters

host
IWebHost

The running IWebHost.

token
CancellationToken

The token to trigger shutdown.

Returns

A Task that completes when shutdown is triggered via Ctrl+C or SIGTERM.

Applies to

Produk Versi
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0