Returns a new iterator to receive elements from this channel using a for loop. Iteration completes normally when the channel is closed for receive without a cause and throws the original close cause exception if the channel has failed.
Retrieves and removes an element from this channel if it's not empty, or suspends the caller while the channel is empty, or throws a ClosedReceiveChannelException if the channel is closed for receive. If the channel was closed because of an exception, it is called a failed channel and this function will throw the original close cause exception.
Retrieves and removes an element from this channel if it's not empty, or suspends the caller while this channel is empty. This method returns ChannelResult with the value of an element successfully retrieved from the channel or the close cause if the channel was closed. Closed cause may be null if the channel was closed normally. The result cannot be failed without being closed.
Returns true if this channel was closed by invocation of close on the SendChannel side and all previously sent items were already received. This means that calling receive will result in a ClosedReceiveChannelException. If the channel was closed because of an exception, it is considered closed, too, but is called a failed channel. All suspending attempts to receive an element from a failed channel throw the original close cause exception.
Clause for the select expression of the receive suspending function that selects with the element received from the channel. The select invocation fails with an exception if the channel is closed for receive (see close for details).
Represents the given receive channel as a hot flow and consumes the channel on the first collection from this flow. The resulting flow can be collected just once and throws IllegalStateException when trying to collect it more than once.
Performs the given action for each received element and cancels the channel after the execution of the block. If you need to iterate over the channel without consuming it, a regular for loop should be used instead.