minWith

suspend fun <E> ReceiveChannel<E>.minWith(
    comparator: Comparator<in E>
): E?
(source)

Platform and version requirements: JVM

Returns the first element having the smallest value according to the provided comparator or null if there are no elements.

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