Package-level declarations

Types

Link copied to clipboard

Exception thrown when attempting to receive from a pull channel that is not ready.

Link copied to clipboard
sealed interface ChannelType<SelfT : ChannelType<SelfT>>

Marker type for distinguishing between push and pull channel semantics.

Link copied to clipboard

Exception thrown when attempting to send data through a push channel that is closed.

Link copied to clipboard

Input channel that can be manually connected to an output channel.

Link copied to clipboard

Output channel that can be manually connected to an input channel.

Link copied to clipboard

A pull input channel that can be manually connected to an output channel.

Link copied to clipboard

A pull output channel that can be manually connected to an input channel.

Link copied to clipboard

A push input channel that can be manually connected to an output channel.

Link copied to clipboard

A push output channel that can be manually connected to an input channel.

Link copied to clipboard
sealed interface InputChannel<out ItemT, ChannelT : ChannelType<ChannelT>>

Base interface for the input side of a communication channel.

Link copied to clipboard

Base interface for the output side of a communication channel.

Link copied to clipboard

Type alias for a pull input channel.

Link copied to clipboard

Type alias for a pull output channel.

Link copied to clipboard

Type alias for a push input channel.

Link copied to clipboard

Type alias for a push output channel.

Functions

Link copied to clipboard
context(_: Simulator)
fun PushInputChannel<*>.close()

Closes this push input channel to prevent further data transfers.

Link copied to clipboard

Checks if this push output channel is open.

Link copied to clipboard

Checks if this input channel uses pull semantics.

Checks if this output channel uses pull semantics.

Link copied to clipboard

Checks if this input channel uses push semantics.

Checks if this output channel uses push semantics.

Link copied to clipboard

Checks if this pull input channel is ready to receive data.

Link copied to clipboard

Marks this pull output channel as no longer ready to receive requests.

Link copied to clipboard

Marks this pull output channel as ready to receive requests.

Link copied to clipboard

Factory function to create a connectable input channel of the specified type.

Link copied to clipboard

Factory function to create a connectable output channel of the specified type.

Link copied to clipboard

Creates a new connectable pull input channel.

Link copied to clipboard

Creates a new connectable pull output channel.

Link copied to clipboard

Creates a new connectable push input channel.

Link copied to clipboard

Creates a new connectable push output channel.

Link copied to clipboard

Creates a new pull channel pair.

Link copied to clipboard

Creates multiple pull channel pairs.

Link copied to clipboard

Creates a new push channel pair.

Link copied to clipboard

Creates multiple push channel pairs.

Link copied to clipboard
fun <T> PullOutputChannel<T>.onPull(callback: context(Simulator) () -> T)

Sets the pull callback that generates data on demand.

Link copied to clipboard
fun <T> PushInputChannel<T>.onReceive(callback: context(Simulator) (T) -> Unit)

Sets the callback that will be invoked when data is received on this channel.

Link copied to clipboard
context(_: Simulator)
fun PushInputChannel<*>.open()

Opens this push input channel to allow data transfers.

Link copied to clipboard
context(_: Simulator)
fun <T> PullInputChannel<T>.receive(): T

Receives data from this pull input channel.

Link copied to clipboard
context(_: Simulator)
fun <T> PushOutputChannel<T>.send(data: T)

Sends data through this push output channel.

Link copied to clipboard
fun PushOutputChannel<*>.whenClosed(callback: context(Simulator) () -> Unit)

Registers a callback to be invoked when this channel closes.

Link copied to clipboard
fun PullInputChannel<*>.whenNotReady(callback: context(Simulator) () -> Unit)

Registers a callback to be invoked when this channel becomes not ready.

Link copied to clipboard
fun PushOutputChannel<*>.whenOpened(callback: context(Simulator) () -> Unit)

Registers a callback to be invoked when this channel opens.

Link copied to clipboard
fun PullInputChannel<*>.whenReady(callback: context(Simulator) () -> Unit)

Registers a callback to be invoked when this channel becomes ready.