Crafting Channel Protocols
Occam channels may be semi-structured connectors, as claimed in Navigating Channels, but some structure never hurts. It’s in your power to make them fully structured. Simply attach protocols.
A protocol is a scheme that allows a channel to carry typed or mixed-type data. Protocols can be simple, sequential, array, or variant (case).
Simple Protocols
A simple protocol mandates that all transferrable items belong to one data type. In the classical Occam, you would supply the data type in the parentheses after the CHAN. KRoC uses the CHAN OF notation:
| | -- "classical" |
| | CHAN(INT) int.channel: |
| | -- KRoC |
| | CHAN OF INT int.channel: |
A process may receive or send only items whose data type matches the channel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access