I am playing around with interactive brokers Java API to get real time market data. My stupid approach in storing the data is to write them to a file (using Java) and read the file every 30 minutes (by calling Python from within Java). This is inefficient.
I am wondering is there a way to actually avoid reading/writing to files and just "stream" the data collected within those 30 minutes and pipe them into Python. Forgive me as I do not know if "stream" is the correct word here. What is the efficient approach to this problem ? Note that I am not looking for code to call a Python program inside Java.