All the code is in the example ping pong project
To accept connection
- create a Node interface, this is parameterised by type.
- Start a node process with a bunch of data (pids or simple data) that should be passed to connecting nodes.
- connect to a node and use the returned data
const interface = node.Interface("uuid")
pub fn run() {
node.start(interface, "hello")
assert Ok(data) = node.connect(interface, "node@127.0.0.1")
// This line would cause a compilation error because the interface type is checked at compile time.
// data + 1
}