I'm downloading relatively large files (10mb each) with urllib2, and then loading it as a json file and inserting data into a mysql database, and then repeating the process in an infinite loop. The downloading takes a minute or so, and then it loads everything into mysql. Is there a way to create a thread that does the downloading while the main thread inserts into mysql using python?
my pseudocode:
while 1:
download file with urllib2
decode as json file
extract data I want
do some computations on data
insert data into mysql
Thank you so much!