awaitEvent

abstract suspend fun awaitEvent(): Event<T>

Assert that an event was received and return it. If no events have been received, this function will suspend for up to timeout.

Throws

kotlinx.coroutines.TimeoutCancellationException

if no event was received in time.