aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/ur/top.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-05 11:48:55 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-05 11:48:55 -0400
commitf6559c7555465c479d45529748deb8c15dfa346c (patch)
treeaffa61639daa2a14b7eb6c9f8bb56617fa62582c /lib/ur/top.ur
parent37eeae6bc2503281d1b806c85aa0e70645fd9966 (diff)
Chat demo
Diffstat (limited to 'lib/ur/top.ur')
-rw-r--r--lib/ur/top.ur26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/ur/top.ur b/lib/ur/top.ur
index 154e88e9..b9728158 100644
--- a/lib/ur/top.ur
+++ b/lib/ur/top.ur
@@ -196,29 +196,3 @@ fun eqNullable' (tables ::: {{Type}}) (agg ::: {{Type}}) (exps ::: {Type})
case e2 of
None => (SQL {e1} IS NULL)
| Some _ => sql_binary sql_eq e1 (sql_inject e2)
-
-
-functor Broadcast(M : sig type t end) = struct
- sequence s
- table t : {Id : int, Client : client, Channel : channel M.t}
-
- type topic = int
-
- val inj : sql_injectable topic = _
-
- val create = nextval s
-
- fun subscribe id =
- cli <- self;
- ro <- oneOrNoRows (SELECT t.Channel FROM t WHERE t.Id = {[id]} AND t.Client = {[cli]});
- case ro of
- None =>
- ch <- channel;
- dml (INSERT INTO t (Id, Client, Channel) VALUES ({[id]}, {[cli]}, {[ch]}));
- return ch
- | Some r => return r.T.Channel
-
- fun send id msg =
- queryI (SELECT t.Channel FROM t WHERE t.Id = {[id]})
- (fn r => Basis.send r.T.Channel msg)
-end