I need to call an API around 1000 times to run a specific function: the problem is each API call takes around 1 second, so running it synchronously is a no no. Running it asynchronously works, but, my mac is capped at running 100 processes in the module multiprocessing.pool(100)
.
from multiprocessing import Pool
pool = Pool()
results = pool.map(multi_run_wrapper, list_args)
So it's nothing complicated by any means, but this falls apart if len(list_args)>100
.
Does anyone have any solutions? I need something to work asynchronously, be time efficient and run in parallel.