class Channel
source · line 20public
public class Channel<T> public constructor(private val capacity: Long)
A FIFO MPMC channel. Zero capacity requires a rendezvous with a receiver.
function send
source · line 33public
public suspend fun send(value: T): Unit
Suspends until the message is committed, or cancellation or closure wins.
parameter value
source · line 33public
value: T
type parameter T
source · line 20public
T
constructor constructor
source · line 20public
constructor(private val capacity: Long)
parameter capacity
source · line 20public
private val capacity: Long
function close
source · line 110public
public fun close(): Boolean
Rejects pending and future sends; committed buffered messages remain available.
function receive
source · line 63public
public suspend fun receive(): T
Receives the next message, or throws after closure and draining.
function tryReceive
source · line 102public
public fun tryReceive(): TryReceiveResult<T>
Attempts a receive without suspending or observing the current Job.
function receiveOrNone
source · line 70public
public suspend fun receiveOrNone(): T?
Returns None only after closure and draining, preserving nullable messages.
function trySend
source · line 94public
public fun trySend(value: T): TrySendResult
Attempts a send without suspending or observing the current Job.
parameter value
source · line 94public
value: T