await

suspend fun <T> MaybeSource<T>.await(): T?

Awaits for completion of the maybe without blocking a thread. Returns the resulting value, null if no value was produced or throws the corresponding exception if this maybe had produced error.

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.