IHost.StopAsync(CancellationToken) 方法
定义
尝试正常停止该程序。Attempts to gracefully stop the program.
public System.Threading.Tasks.Task StopAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member StopAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function StopAsync (Optional cancellationToken As CancellationToken = Nothing) As Task
参数
- cancellationToken
- CancellationToken
用于指示停止应不再正常的时间。Used to indicate when stop should no longer be graceful.
返回
IHost 停止时将完成的 Task。A Task that will be completed when the IHost stops.