summaryrefslogtreecommitdiff
path: root/tests/timeout.ur
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-08-05 20:06:17 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-08-05 20:06:17 -0400
commitc921d0df325c803fed8c7742eb088cb3d030d541 (patch)
tree16d374660aa9adb92c2f08317a20d61ae995ef9a /tests/timeout.ur
parenta3e471e933945dcfb54873cb20c691a193b55671 (diff)
parentbd6f549a527856db3878f1586c6666646a45d8ee (diff)
Merge branch 'upstream' into dfsg_clean20160805+dfsg
Diffstat (limited to 'tests/timeout.ur')
-rw-r--r--tests/timeout.ur22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/timeout.ur b/tests/timeout.ur
new file mode 100644
index 00000000..d96b42bd
--- /dev/null
+++ b/tests/timeout.ur
@@ -0,0 +1,22 @@
+table listeners : { Ch : channel unit }
+
+fun ping () =
+ queryI1 (SELECT * FROM listeners)
+ (fn r => send r.Ch ())
+
+fun main () =
+ ch <- channel;
+ dml (INSERT INTO listeners(Ch) VALUES ({[ch]}));
+ count <- source 0;
+ return <xml><body onload={let
+ fun loop () =
+ _ <- recv ch;
+ c <- get count;
+ set count (c + 1);
+ loop ()
+ in
+ loop ()
+ end}>
+ <dyn signal={n <- signal count; return (txt n)}/>
+ <button onclick={fn _ => rpc (ping ())}>Ping</button>
+ </body></xml>