submit as many requests as you wish (use one connection). No, it does not create a separate thread for every stock. There is a single "event dispatching" thread that will be calling delegates methods - so you do not need to synchronize them - responses to different requests will arrive serially.
Internally, there are three threads there in addition to the "main" thread (you have exposure to one of them - the event dispatching thread, other two threads are internal: "writer" thread that sends data to the OT server, and "reader" thread that reads data).
-Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
If i want to subscribe to receive streaming for multiple stocks, i do the following
TickStreamCommand command = new TickStreamCommand();
command.setExchangeCode("Q");
command.setSymbolCode("MSFT");
.....
IRequest request = connection.prepareRequest(command);
request.submit();
does it create a separate thread for each stock ? Or Is there some multiplex mechanism underneath
Thank you for your answer
Hi,
submit as many requests as you wish (use one connection). No, it does not create a separate thread for every stock. There is a single "event dispatching" thread that will be calling delegates methods - so you do not need to synchronize them - responses to different requests will arrive serially.
Internally, there are three threads there in addition to the "main" thread (you have exposure to one of them - the event dispatching thread, other two threads are internal: "writer" thread that sends data to the OT server, and "reader" thread that reads data).
-Mike