awaitItem

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

Assert that the next event received was an item and return it. This function will suspend if no events have been received.

Throws

if the next event was completion or an error.