I have some questions related to reading messages as followings:
1. I see EJavaSignal is used in `new Socket(this, EJavaSignalObj)`, but what is it exactly?
2. https://interactivebrokers.github.io/tws-api/classIBApi_1_1EReader.html
https://interactivebrokers.github.io/tws-api/interfaceIBApi_1_1EReaderSignal.html
EReader class *captures incoming messages to the API client and places them into a queue* and that the EReaderSignal] interface *notifies the thread reading information from the TWS whenever there are messages ready to be consumed.*
Is EJavaSignal a concrete class of EReaderSignal and so has `issueSignal()` and `waitForSignal()` defined so `EJavaSignalObj.issueSignal()` is telling `EReaderObj` something arrived in the queue?
3. In EReader, what does `start()` do? Does it start a new thread and listen to EReaderSignal (==EJavaSignal) for message ready? If so, isn't it listening (ie waiting) for messages automatically, and why need to be told to wait by waitForSignal()?
4. What does `EReaderObj.processMsgs()` do? Is it called to call the relevant callback function of EWrapper? So if the message is about historical data, the HistoricalData() callback is invoked?
5. By design, 2 threads will be used, where one (main) is the client thread calling `reqHistoricalData()`, and to receive anything, EReaderObj.start() must be called to open a reader thread to listen to requested messages as well as storing (automatically?) messages in a queue. Then `processMsgs()` pushes the data off the queue from the reader thread to the client thread?
1. I see EJavaSignal is used in `new Socket(this, EJavaSignalObj)`, but what is it exactly?
2. https://interactivebrokers.github.io/tws-api/classIBApi_1_1EReader.html
https://interactivebrokers.github.io/tws-api/interfaceIBApi_1_1EReaderSignal.html
EReader class *captures incoming messages to the API client and places them into a queue* and that the EReaderSignal] interface *notifies the thread reading information from the TWS whenever there are messages ready to be consumed.*
Is EJavaSignal a concrete class of EReaderSignal and so has `issueSignal()` and `waitForSignal()` defined so `EJavaSignalObj.issueSignal()` is telling `EReaderObj` something arrived in the queue?
3. In EReader, what does `start()` do? Does it start a new thread and listen to EReaderSignal (==EJavaSignal) for message ready? If so, isn't it listening (ie waiting) for messages automatically, and why need to be told to wait by waitForSignal()?
4. What does `EReaderObj.processMsgs()` do? Is it called to call the relevant callback function of EWrapper? So if the message is about historical data, the HistoricalData() callback is invoked?
5. By design, 2 threads will be used, where one (main) is the client thread calling `reqHistoricalData()`, and to receive anything, EReaderObj.start() must be called to open a reader thread to listen to requested messages as well as storing (automatically?) messages in a queue. Then `processMsgs()` pushes the data off the queue from the reader thread to the client thread?
Last edited: