consumeEach

inline suspend fun <E> BroadcastChannel<E>.consumeEach(
    action: (E) -> Unit
): Unit
(source)

Platform and version requirements: JVM

Subscribes to this BroadcastChannel and performs the specified action for each received element.

inline suspend fun <E> ReceiveChannel<E>.consumeEach(
    action: (E) -> Unit
): Unit
(source)

Platform and version requirements: JVM

Performs the given action for each received element.

This function consumes all elements of the original ReceiveChannel.