ReceiveChannel
Receiver's interface to a Channel.
Combined, SendChannel and ReceiveChannel define the complete Channel interface.
Inheritors
Properties
Returns true
if the channel contains no elements and isn't closed for receive
.
Clause for the select expression of the receiveCatching suspending function that selects with a ChannelResult when an element is retrieved or the channel gets closed.
Functions
Closes the channel for new elements and removes all existing ones.
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.
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 exception passed to close if there was one.
Represents the given receive channel as a hot flow and receives from the channel in fan-out fashion every time this flow is collected. One element will be emitted to one collector only.
Retrieves an element, removing it from the channel.
Attempts to retrieve an element without waiting, removing it from the channel.