WebHostExtensions.WaitForShutdownAsync(IWebHost, CancellationToken) 方法

定義

會傳回透過指定權杖 Ctrl+C 或 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

參數

host
IWebHost

執行中的 IWebHost

token
CancellationToken

要觸發關機的權杖。

傳回

Task 會在透過 Ctrl+C 或 SIGTERM 觸發關機時完成。

適用於