i am running a script which takes in a url and downloads the file locally, and then passes the filename as an argument to a function.The problem is doing this takes a lot of time.So i tried using Threadpool,but this does not give any improvements.Am i doing this wrong, here is what it looks like.
pool = ThreadPool(processes=8)
ocr_result = pool.apply_async(download_file, (url,))
file_name = ocr_result.get()
async_result = pool.apply_async(return_label, (file_name,))
prediction, prediction_list = async_result.get()
Any suggestions would be really helpful. Thanks in advance.
asyncio+aiohttp