Mercurial > urweb
comparison tests/channel.ur @ 670:f73913d97a40
Proper recv
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 22 Mar 2009 16:03:45 -0400 |
parents | f68eee90dbcf |
children |
comparison
equal
deleted
inserted
replaced
669:f68eee90dbcf | 670:f73913d97a40 |
---|---|
1 fun main () : transaction page = | 1 fun main () : transaction page = |
2 ch <- channel; | 2 ch <- channel; |
3 let | 3 let |
4 fun onload () = | 4 fun make () = |
5 subscribe ch; | 5 subscribe ch; |
6 send ch "Hello world!" | 6 send ch "Hello world!" |
7 | |
8 fun echo () = | |
9 msg <- recv ch; | |
10 alert(msg); | |
11 echo () | |
12 | |
13 fun onload () = | |
14 make (); | |
15 echo () | |
7 | 16 |
8 fun haveAnother () = | 17 fun haveAnother () = |
9 send ch "Here's another." | 18 send ch "Here's another." |
10 in | 19 in |
11 return <xml><body onload={onload ()}> | 20 return <xml><body onload={onload ()}> |