Can someone explain this function in u.q in kdb+tick
del:{w_:w[x;;0]?y};.z.pc:{del[;x]each t};
Questions:
-
What does it do ?
-
Where is y coming from
-
Any sample calling code ?
Can someone explain this function in u.q in kdb+tick
del:{w_:w[x;;0]?y};.z.pc:{del[;x]each t};
Questions:
What does it do ?
Where is y coming from
Any sample calling code ?
.z.pc takes only 1 argument. x is the implicitly declared first argument, which is the connection handle just closed. .z.pc calls del[table1; handle], del[table2; handle], del[table3; handle].
.u.del takes 2 implicitly declared arguments, namely x and y. x is a table name, y is the handle just closed.
I am just pulling out these information out of my memory. I have not checked them for a while. Go fire up the ticker plant, add some real-time subscribers, and add some show statements. .u.w should contain a nested table with handles, table names and subscribed symbols.
http://www.kx.com/q/d/FD\_kdb+tick\_manual\_1.0.doc
.u.t: all tables in the current tickerplant process.
.u.w: this is a global dictionary which contains the connection handles and sym subscription lists for each table in .u.t for all subscribers.
.u.sub: when a client subscribes it (asynchronously) calls this function with the table and sym list as arguments. This function then adds the process handle of whoever called it together with the sym list (the second argument) to the subscription list .u.w. It also immediately returns to the caller a two element list, consisting of the name of the table they subscribed to plus the data. Subsequent to this the caller will be updated asynchronously via the pub function.
.u.del: deletes a connection handle from the subscription list.