findLast

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

Platform and version requirements: JVM

Returns the last 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.