Skip to content

Instantly share code, notes, and snippets.

@falexandrou
Created April 24, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save falexandrou/477a7da466229bb2517edf199bd79365 to your computer and use it in GitHub Desktop.
Save falexandrou/477a7da466229bb2517edf199bd79365 to your computer and use it in GitHub Desktop.
with ThreadPoolExecutor(max_workers=os.cpu_count()) as executor:
futures = executor.map(process_func, plays)
for future in as_completed(futures, timeout=None):
failures += 1 if future.exception() else 0
executor.shutdown(wait=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment