primitive consumer(in<u32> input) {
sync {
print("C: going to receive a value");
auto v = get(input);
print("C: I have received a value");
}
print("C: I am now exiting");
}
primitive producer(out<u32> output) {
sync {
print("P: Going to send a value!");
put(output, 1337);
print("P: I just sent a value!");
}
print("P: I am exiting");
}
composite main() {
channel output -> input;
new consumer(input);
new producer(output);
}