darcsden :: alex -> the -> blob

the programming language

root / examples / concurrency.the

1
2
3
4
5
6
7
8
9
10
11
process = { sender |
    x = receive;
    x print;
    "waiting for 1 second..." write;
    1000000 sleep;
    sender ! [@got, x]
} spawn: [self];

process ! "hello, world!";

receive print