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.
Just make sure to not block the main ticker thread receiving ticks as told here:
https://kite.trade/forum/discussion/7399/kiteconnect-ticker-connection-error-1006-connection-was-closed-uncleanly-none
The procedure has already been shown in the above mentioned discussion by Rakesh Sir.
You can also use threading/multiprocessing modules.