I am building a script to download and parse benefits information for health insurance plans on Obamacare exchanges. Part of this requires downloading and parsing the plan benef
As an alternative solution, you can call add_done_callback
on your futures and not use as_completed
at all. The key is NOT keeping references to futures. So future_to_url
list in original question is a bad idea.
What I've done is basically:
def do_stuff(future):
res = future.result() # handle exceptions here if you need to
f = executor.submit(...)
f.add_done_callback(do_stuff)