send

suspend fun send(data: T, onClose: () -> Unit = {})(source)

Sends data along with a close action to the channel.

Parameters

data

The data to be sent.

onClose

The action to be executed when the data is no longer needed.