-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IB Disconnection #28
Comments
There is a thread running to process the internal queue of IB data from the level 1&2 subscribers, and order events. Is there an issue with these threads continuing to run even if there are no current level 1 subscribers? |
The program need to have proper exit. In order to exit properly, we need to stop the running threads. Is there anyway to stop it? |
I see. Probably the easiest thing to do will be to convert the threads to daemon threads, so if they are still running when the main thread stops, the application will shut down without needing to stop the daemon threads. |
Hi Rob, I think what Vince mentioned was partly caused by blocked threads in IBQuoteProcessor. public void run() {
while( shouldRun ) {
try {
processData( quoteBlockingQueue.take() );
} catch( Exception ex ) {
//logger.error(ex, ex);
ex.printStackTrace();
}
}
} When stopProcessor() method was called, shouldRun is changed to false with intention to exit the while loop, but the thread could be permablocked if no new data is put into the queue. I suggest to also interrupt this thread in stopProcessor() |
Ok, I see what you are saying now. You're right, if you aren't subscribed to any quotes, or if its after market hours and no quotes are coming in. The other option would be to use the |
I have noticed that there are some threads running after calling the InteractiveBrokersClientInterface.unsubscribeLevel1() method as well as
InteractiveBrokersClientInterface.disconnect(). Are there any methods which can be used to close the running threads after the connect() method and subscribeLevel1() method?
The text was updated successfully, but these errors were encountered: