-
What is the execution flow of this file
I am studying the official example code from here: https://github.com/kxcontrib/websocket/blob/master/AppendixB/pubsub.q . After some research, I can get the publisher/subscriber model running and I can understand the basic idea on how the feedhandler part (i.e., this file: https://github.com/kxcontrib/websocket/blob/master/AppendixB/fh.q) works. However, I am still very confusing on how the publisher part (i.e., this file: https://github.com/kxcontrib/websocket/blob/master/AppendixB/pubsub.q) works.
I understand that when the code is initially executed, it listens on port 5001 and it defines a few tables (trade, quote, subs) and functions (loadPage, filterSyms, getSyms, getQuotes, getTrades, sub, pub). Does it mean that the interpreter directly jumps to the end of the file, that is, these two lines:
.z.ts:{pub each til count subs}; t 1000
and starts something like a “main loop” in winForm development?
Suppose my guess is right, the loop keeps calling the function pub until there aren’t any new rows in the table subs. But how does subs get any new rows in the first place?
Sorry, there were no replies found.
Log in to reply.