onReceive

fun <T> PushInputChannel<T>.onReceive(callback: context(Simulator) (T) -> Unit)

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

Parameters

callback

the lambda to handle received data