HostingAbstractionsHostExtensions.WaitForShutdownAsync(IHost, CancellationToken) 方法

定义

返回在通过给定令牌触发关闭时完成的任务。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 = Nothing) As Task

参数

host
IHost

正在运行的 IHostThe running IHost.

token
CancellationToken

用于触发关闭的令牌。The token to trigger shutdown.

返回

Task

表示异步操作的 TaskThe Task that represents the asynchronous operation.

适用于