await
Awaits the completion of the task without blocking a thread.
This suspending function is cancellable. If the Job of the current coroutine is cancelled while this suspending function is waiting, this function stops waiting for the completion stage and immediately resumes with CancellationException.
For bi-directional cancellation, an overload that accepts CancellationTokenSource can be used.
Awaits the completion of the task that is linked to the given CancellationTokenSource to control cancellation.
This suspending function is cancellable and cancellation is bi-directional:
If the Job of the current coroutine is cancelled while this suspending function is waiting, this function cancels the cancellationTokenSource and throws a CancellationException.
If the task is cancelled, then this function will throw a CancellationException.
Providing a CancellationTokenSource that is unrelated to the receiving Task is not supported and leads to an unspecified behaviour.