await

suspend fun await(): T

waits for finishing the task within a suspending function. returns result or throws exception if exception occurred

See also

for asynchronous version of this