awaitComplete

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

Assert that attempting to read from the ReceiveChannel yields ClosedReceiveChannelException, indicating that it was closed without an exception.

Throws

if the next event was an item or an error.