summaryrefslogtreecommitdiff
path: root/tests/roundTrip.ur
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roundTrip.ur')
-rw-r--r--tests/roundTrip.ur12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/roundTrip.ur b/tests/roundTrip.ur
index d22b2d41..0ee3f8f7 100644
--- a/tests/roundTrip.ur
+++ b/tests/roundTrip.ur
@@ -1,12 +1,18 @@
table channels : { Client : client, Channel : channel (string * int * float) }
PRIMARY KEY Client
+table dearlyDeparted : { Client : option client, When : time }
+
+task clientLeaves = fn cli : client =>
+ dml (INSERT INTO dearlyDeparted (Client, When) VALUES ({[Some cli]}, CURRENT_TIMESTAMP));
+ debug "Our favorite client has LEFT!"
+
fun writeBack v =
me <- self;
r <- oneRow (SELECT channels.Channel FROM channels WHERE channels.Client = {[me]});
send r.Channels.Channel v
-fun main () =
+fun main' () =
me <- self;
ch <- channel;
dml (INSERT INTO channels (Client, Channel) VALUES ({[me]}, {[ch]}));
@@ -27,7 +33,7 @@ fun main () =
fun sender s n f =
sleep 2000;
- writeBack (s, n, f);
+ rpc (writeBack (s, n, f));
sender (s ^ "!") (n + 1) (f + 1.23)
in
return <xml><body onload={onDisconnect (alert "Server booted me");
@@ -37,3 +43,5 @@ fun main () =
<dyn signal={Buffer.render buf}/>
</body></xml>
end
+
+fun main () = return <xml><body><form><submit action={main'}/></form></body></xml>