Multiple threads to make calculations based on Web socket data

rageisthan
rageisthan edited June 2022 in Python client
Question: Can I create three different threads, Main thread to fetch data, second thread and third thread to do calculations as below.

I am fairly new at Python and programming as a whole. I am planning to modify my incoming streaming data before storing it in a database. I need to run two separate modifications on the data, independent of each other. The same original data will be used twice independently in two different processes.

One process will get the data and make certain CPU Intensive calculations and return a dataframe.

The other process will creating a dataframe from the collection of the ticks received, along with their instrument_name, and will fetch data from the dataframe created in the other process. I read up on the thread here and could not figure out a way to create three threads.


Thank you to everyone who helps.
Sign In or Register to comment.