diff options
Diffstat (limited to 'lib/ur/top.ur')
-rw-r--r-- | lib/ur/top.ur | 26 |
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 |