WebHostExtensions.WaitForShutdownAsync(IWebHost, CancellationToken) Method

Definition

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

public static System.Threading.Tasks.Task WaitForShutdownAsync (this Microsoft.AspNetCore.Hosting.IWebHost host, System.Threading.CancellationToken token = default);
static member WaitForShutdownAsync : Microsoft.AspNetCore.Hosting.IWebHost * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WaitForShutdownAsync (host As IWebHost, Optional token As CancellationToken = Nothing) As Task

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