I am in the planning stages for developing a VB.Net class (I am using VS 2008) that is to obtain data via an API provided by a COM object (AxInterop.TWSLib) making requests to
an Internet server. The API provides data via events. The class should do its work on a separate thread; it takes several seconds (sometimes up to ~10) to collect the desired data. One should be able to instantiate several instances of the class in order to
collect data in parallel. The class would be given a reference to the TWSLib object when its constructor is called, as well as several parameters. There needs to be a way for the class to provide results, preferably in the form of a generic list.
I have succeeded creating multithreads using the backgroundworker approach. From what I have read, though, that does not appear to be the appropriate approach when the background
thread is supposed to wait for events to handle. I have not tackled more advanced multithreading approaches. Studying VS 2008 documentation on Threading, ThreadPool, delegates, etc. has not yet given me an idea how to design a class that handles those API
View Complete Post