unison/unison-src/pingpong.u

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;;
;;