import std.stdio; import std.concurrency;
void writer() { try { while (true) { receive((string s){ writefln(s); }); } } catch (OwnerTerminated ex) { // die. } } void sender(Tid writer) { send(writer, "world"); } void main(string[] args) { auto writer = spawn(&writer); send(writer, "hello"); spawn(&sender, writer); }