receiveFromChannel

fun receiveFromChannel(condition: Predicate<T>, waitStats: Boolean = true): List<T>

Finds the items in the channel according to the condition and removes them. The channel must not be empty.

Return

a list of the items found. May be empty if nothing is found that matches the condition.

Parameters

condition

the criteria for selecting the items

waitStats

indicates whether waiting time statistics should be collected