Home › Forums › kdb+ › What is the purpose of publishing value each t to t in .u.pub? › Re: What is the purpose of publishing value each t to t in .u.pub?
-
This is batching mode when the timer
t
is set. https://code.kx.com/q/basics/syscmds/#t-timerIn this mode the TP will cache data and only publish it when the timer triggers
.z.ts
https://code.kx.com/q/ref/dotz/#zts-timerIn this case
t
is a list of tables and it callspub
on each of them ('
form) https://code.kx.com/q/ref/maps/#eachvalue
is called so that the cached data from the TP is populated inpub
to send to subscribers (RDB etc.)Some more information on batch mode: https://code.kx.com/q/wp/tick-profiling/
q)upd'[t;value each t] //A demo 'upd' which prints the parameters sent to it q)a:([] c1:1 2 3) q)b:([] c2:4 5 6) q)t:tables[] //Create list of tables q)t `s#`a`b q)upd'[t;value each t] (`a;+(,`c1)!,1 2 3) (`b;+(,`c2)!,4 5 6)