WindowsServiceLifetime.WaitForStartAsync(CancellationToken) 方法

定义

异步等待,直到启动完成,然后再继续。Asynchronously waits until start is complete before continuing. StartAsync(CancellationToken) 开头调用此方法。This method is called at the beginning of StartAsync(CancellationToken). 它可用于延迟启动,直到外部事件发出信号。This can be used to delay startup until signaled by an external event.

public:
 virtual System::Threading::Tasks::Task ^ WaitForStartAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task WaitForStartAsync (System.Threading.CancellationToken cancellationToken);
abstract member WaitForStartAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.WaitForStartAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WaitForStartAsync (cancellationToken As CancellationToken) As Task

参数

cancellationToken
CancellationToken

指示停止应该不再正常的取消标记。A cancellation token that indicates when stop should no longer be graceful.

返回

Task

表示异步等待启动操作的任务。A task that represents the asynchronous waiting for start operation.

实现

适用于