HostingAbstractionsHostExtensions.WaitForShutdownAsync(IHost, CancellationToken) Method

Definition

Returns a Task that completes when shutdown is triggered via the given token.

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

Parameters

host
IHost

The running IHost.

token
CancellationToken

The token to trigger shutdown.

Returns

The Task that represents the asynchronous operation.

Applies to