WindowsServiceLifetime.WaitForStartAsync(CancellationToken) Metodo

Definizione

Attende in modo asincrono che l'avvio venga completato prima di continuare. Questo metodo viene chiamato all'inizio di StartAsync(CancellationToken). Questo è utile per ritardare l'avvio fino al segnale trasmesso da un evento esterno.

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

Parametri

cancellationToken
CancellationToken

Token di annullamento che indica quando l'arresto non deve più essere graziato.

Restituisce

Attività che rappresenta l'attesa asincrona per l'operazione di avvio.

Implementazioni

Eccezioni

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Si applica a