summaryrefslogtreecommitdiff
path: root/tests/timeout.ur
diff options
context:
space:
mode:
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>