Created
March 26, 2018 23:44
-
-
Save gzzo/275d02f69e686baa9aebf5688c0b6d65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
results = deque(pool.apply_async(...) for job in jobs) | |
while results: | |
current = results.popleft() | |
try: | |
current_result = current.get(0.1) | |
process(current_result) | |
except multiprocessing.TimeoutError: | |
results.append(current) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment