ChannelWithCloseableData
class ChannelWithCloseableData<T>(capacity: Int = RENDEZVOUS, onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND) : ReceiveChannel<ChannelWithCloseableData.CloseableData<T>> (source)
A channel that sends and receives data along with a close action to be executed when the data is no longer needed.
Parameters
T
The type of data to be sent and received.
capacity
The capacity of the channel.
onBufferOverflow
The behavior when the buffer overflows.
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val onReceiveCatching: SelectClause1<ChannelResult<ChannelWithCloseableData.CloseableData<T>>>
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Receives data along with its close action from the channel.
Link copied to clipboard
open suspend override fun receiveCatching(): ChannelResult<ChannelWithCloseableData.CloseableData<T>>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Receives data from the channel and uses it in a block, ensuring that the data is properly closed after use.