OutputChannel

Base interface for the output side of a communication channel.

The output side connects the upstream Node to the downstream InputChannel.

Parameters

ItemT

the type of items transmitted through this channel

ChannelT

the channel type (Push or Pull)

Inheritors

Properties

Link copied to clipboard
abstract val downstream: InputChannel<*, ChannelT>

The input channel connected downstream.

Link copied to clipboard
abstract val transmissionCount: Int

Total number of data transmissions through this channel.

Link copied to clipboard
abstract val upstreamNode: Node

The Node that sends data through this output channel.

Functions

Link copied to clipboard

Checks if this push output channel is open.

Link copied to clipboard

Checks if this output channel uses pull semantics.

Link copied to clipboard

Checks if this output channel uses push semantics.

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
fun <T> PullOutputChannel<T>.onPull(callback: context(Simulator) () -> T)

Sets the pull callback that generates data on demand.

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 PushOutputChannel<*>.whenOpened(callback: context(Simulator) () -> Unit)

Registers a callback to be invoked when this channel opens.