find

inline suspend fun <E> ReceiveChannel<E>.find(
    predicate: (E) -> Boolean
): E?
(source)

Platform and version requirements: JVM

Returns the first element matching the given predicate, or null if no such element was found.

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