summaryrefslogtreecommitdiff
path: root/tests/rpchan.ur
blob: 08308d90a4725ba5b72751e69510be4c549285e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fun remote () =
    ch <- channel;
    send ch "Hello World!";
    return ch

fun remoter () =
    ch <- channel;
    send ch "Hello World!";
    return <xml><active code={spawn (s <- recv ch; alert s); return <xml/>}/></xml>

fun main () =
    x <- source <xml/>;
    return <xml><body>
      <button onclick={fn _ => ch <- rpc (remote ()); s <- recv ch; alert s}>TEST</button>
      <button onclick={fn _ => y <- rpc (remoter ()); set x y}>TESTER</button>
      <hr/>
      <dyn signal={signal x}/>
    </body></xml>