Mercurial > urweb
view tests/spawn.ur @ 1448:37599e85bba8
Fix getting UTC time from formatted strings ( in uw_Basis_readUtc ).
Corrects 2 things:
- timezones with offsets not an integer number of hours
- double correcting for daylight savings time
author | Karn Kallio <kkallio@eka> |
---|---|
date | Wed, 13 Apr 2011 00:04:41 -0430 |
parents | 7ea0df9e56b6 |
children |
line wrap: on
line source
table t : {A : int, Ch : channel string} fun listener n ch = s <- recv ch; alert (show n ^ ": " ^ s); listener n ch fun speak id msg = r <- oneRow (SELECT t.Ch FROM t WHERE t.A = {[id]}); send r.T.Ch msg fun main () : transaction page = ch1 <- channel; dml (INSERT INTO t (A, Ch) VALUES (1, {[ch1]})); ch2 <- channel; dml (INSERT INTO t (A, Ch) VALUES (2, {[ch2]})); s1 <- source ""; s2 <- source ""; return <xml><body onload={spawn (listener 1 ch1); spawn (listener 2 ch2)}> 1: <ctextbox source={s1}/><button onclick={msg <- get s1; speak 1 msg}/><br/> 2: <ctextbox source={s2}/><button onclick={msg <- get s2; speak 2 msg}/> </body></xml>