Scoop API

scoop:scoop.concurrent:0.1.0

Channel

class Channel

source · line 20
public
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 33
public
public suspend fun send(value: T): Unit

Suspends until the message is committed, or cancellation or closure wins.

function close

source · line 110
public
public fun close(): Boolean

Rejects pending and future sends; committed buffered messages remain available.

function receive

source · line 63
public
public suspend fun receive(): T

Receives the next message, or throws after closure and draining.

function receiveOrNone

source · line 70
public
public suspend fun receiveOrNone(): T?

Returns None only after closure and draining, preserving nullable messages.