You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We can use a with statement to ensure threads are cleaned up promptlywithconcurrent.futures.ThreadPoolExecutor(max_workers=5) asexecutor:
# Start the load operations and mark each future with its URLfuture_to_url= {executor.submit(load_url, url, 60): urlforurlinURLS}
forfutureinconcurrent.futures.as_completed(future_to_url):
url=future_to_url[future]
try:
data=future.result()
exceptExceptionasexc:
print('%r generated an exception: %s'% (url, exc))
else:
print('%r page is %d bytes'% (url, len(data)))
https://stackoverflow.com/questions/51071378/exception-handling-in-concurrent-futures-executor-map
The text was updated successfully, but these errors were encountered: