I have a ticker plant that has the schema:
quote:([]time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())
trade:([]time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())
rfills:([]time:();sym:();expiration:();tag:();price:();volume:())
I then double check the schema by doing
meta trade
I subscribe to the tickerplant as such getting the trade table
h(`.u.sub;`trade;`)
But when I try to specify a symbol from sym by doing
h(`.u.sub;`trade;`ZB)
No records are being pushed, This is odd because when I subscribe to all syms you can see that `ZB is definitely sym being pushed as shown below after setting upd to show
Figured out the above question, as a single record was being pushed not a table or key-value pair.This is what is going on. So I was publishing a single record not a table from qSharp:
string giantstring2 = ".u.upd[" + "`trade;" + qdatetime + "," + rsymbol + "," + rexp + "," + qtype + "," + qprice + "," + qcondition + "," + qexchange + "," + qvolume + " ]";
q.Async(giantstring2);
I then set .u.upd to be .u.pub . So clients are recieve the single record but since its not a table nor a key value pair it doesn't grab the sym. So then I decided to change .u.upd to be
.u.upd:{[tabname;tabdata]
tabname insert tabdata;
tabd1::tabdata;
r2:: last (eval tabname);
.u.pub[tabname; r2];
};
So now subscribing by sym works however there is another issue, now it keeps publishes the entire table not just the record. Thinking of how to make this do what I want however I'm not sure how to go about it. Upon investigation of the .u.pub function
{[t;x]{[t;x;w]if[count x:sel[x]w 1;(neg first w)(`upd;t;x)]}[t;x]each w t}
It looks like it goes through the table and publishes each record. I assume I can edit this to just submit the last record and everything should work how I expect it to. Although I am unsure how to that. Any ideas? I assume I need to change the each w t part to only grab the last record and not the entire table