Is it possible to subscribe to two remote tickerplants from one q process and update the local q process table. Considered creating two separate processes and updating via hopen but not convinced that is the most efficient approach. Regards.
Yes, it’s possible (and common) to subscribe to two tickerplants simultaneously - even if both subscriptions update the same table(s), with presumably non-duplicate data sources.
One thing to keep in mind is that you’ll likely get two end of day (.u.end) triggers from both tickerplants so you may need additional logic in your subscriber to ensure you don’t rollover twice.
Terry
Hi there,
Yes this is indeed possible. Let’s assume two tickerplants on a remote machine one on port 8000 and one on 9000, in a fresh q session we could write:
t1:hopen:remoteIP:8000:user:pass <br>t2:hopen
:remoteIP:9000:user:pass
upd:{[t;x] your_upd_code_goes here}
t1(u.sub;
trades;)<br>t2(
u.sub;quotes;
)
So basically open up two connections using hopen assign the handles to two different variables, and then use .u.sub with both. trades and
quotes are just examples here, you could subscribe to all tables
from both.
To keep track of which tickerplant is sending which bit of info you could make use of .z.w inside the upd function which is the handle of the remote process calling it.
Regards
Sean