takeEvent

fun <T> ReceiveChannel<T>.takeEvent(name: String? = null): Event<T>

Assert that the next event received was non-null and return it. This function will not suspend. On JVM and Android, it will attempt to throw if invoked in a suspending context.

Throws

if the next event was completion or an error.