toMutableSet

suspend fun <E> ReceiveChannel<E>.toMutableSet(): MutableSet<E> (source)

Platform and version requirements: JVM

Returns a mutable set containing all distinct elements from the given channel.

The returned set preserves the element iteration order of the original channel.

The operation is terminal. This function consumes all elements of the original ReceiveChannel.