I am building an application that will use eikon .net api along with redi api.
I need to process pricing in the background thread and call subscription as needed. I googled 'DispatcheFrame' but still not clear how I should be structuring my code.
1. Current example creates/starts subscription and then calls Dispatcher.PushFrame() which stops code from executing next line. How do I add new subscriptions?
2. Any problem if I were to wrap this in a worker thread? It seems to work but not sure whether it will cause problem.
I'd appreciate advice on how I should be structuring the code in multi threaded environment. Currently, I am testing it in the console app but eventually it will be a gui app.
In addition to the response from @Zhenya Kovalyov, I would very strongly recommend implementing all data retrieval on a single thread. It can very well be a worker thread, but it should be a single thread and Windows message pump must be running on this thread. In a GUI application it's best to do all data retrieval on the GUI thread.
@39783854-26aa-4fea-bc93-00b2ec21f8bb the .NET api requires manual pumping of the event loop, DispatcherFrame is just a replacement for Application.DoEvents(). In the console app context (sample apps) it is required, so program is prevented from exiting before the event arrives.
I do not think using it in a multi-threaded environment is going to cause problems.