We are lacking at least one critical primitive:
recv on port<T> with timeout that returns an option<T>
It may be desirable to recv from multiple ports at once, which may need
recv on [port<T>] that returns (uint, T)
recv on [port<T>] with timeout that returns option<(uint, T)>
recv_some on [port<T>] with timeout that returns [T] or [(int, T)]
- These calls assume a fixed message type, it would be nice if it was possible to
recv from a set of differently typed ports at once and match on the result somehow
These calls perhaps would be useful for sending to many channels:
send_any(value: T, channels: [chan<T>]) that returns the uint vec index of the channel actually used
- with the channel selected fairly from
channels
send_ready(value: T, channels: [chan<T>]) that returns the uint vec index of the channel actually used
- with the channel selected fairly among ready channels from
channels
send_all(value: T, channels: [chan<T>])
We are lacking at least one critical primitive:
recvonport<T>with timeout that returns anoption<T>It may be desirable to
recvfrom multiple ports at once, which may needrecvon[port<T>]that returns(uint, T)recvon[port<T>]with timeout that returnsoption<(uint, T)>recv_someon[port<T>]with timeout that returns[T]or[(int, T)]recvfrom a set of differently typed ports at once and match on the result somehowThese calls perhaps would be useful for sending to many channels:
send_any(value: T, channels: [chan<T>])that returns theuintvec index of the channel actually usedchannelssend_ready(value: T, channels: [chan<T>])that returns theuintvec index of the channel actually usedchannelssend_all(value: T, channels: [chan<T>])