await

abstract suspend fun await(): T (source)

Awaits for completion of this value without blocking a thread and resumes when deferred computation is complete, returning the resulting value or throwing the corresponding exception if the deferred had completed exceptionally.

This suspending function is cancellable. If the Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function immediately resumes with CancellationException.

This function can be used in select invocation with onAwait clause. Use isCompleted to check for completion of this deferred value without waiting.