minBy

inline suspend fun <E, R : Comparable<R>> ReceiveChannel<E>.minBy(
    selector: (E) -> R
): E?
(source)

Platform and version requirements: JVM

Returns the first element yielding the smallest value of the given function or null if there are no elements.

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