takeComplete

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

Assert that the next event received is Event.Complete. 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.