mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-19 06:17:33 +03:00
18 lines
426 B
Plaintext
18 lines
426 B
Plaintext
-- run from unison root directory
|
|
-- curl -H "Content-Type: text/plain; charset=UTF-8" --data-binary @unison-src/pingpong.u http://localhost:8081/compute/root
|
|
|
|
do Remote
|
|
n1 := Remote.spawn;
|
|
n2 := Remote.spawn;
|
|
let rec
|
|
ping i = do Remote
|
|
i := Remote.at n2 (i + 1);
|
|
if (i >=_Number 5) (pure i) (pong i);;
|
|
;
|
|
pong i = do Remote
|
|
i := Remote.at n1 (i + 1);
|
|
ping i;;
|
|
;
|
|
ping 0;;
|
|
;;
|