HostingAbstractionsHostExtensions.WaitForShutdownAsync(IHost, CancellationToken) HostingAbstractionsHostExtensions.WaitForShutdownAsync(IHost, CancellationToken) 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 = null);
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 IHost IHost

The running IHost.

token
CancellationToken CancellationToken CancellationToken

The token to trigger shutdown.

Returns

Applies to