Last active
November 24, 2018 22:08
-
-
Save devxpy/beea2b967913aabdadc144834d0d4722 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
def roundrobin(pending): | |
remaining = set(pending) | |
index = 0 | |
while remaining: | |
for requester in list(remaining): | |
try: | |
if process_success(requester, pending[requester][index]): | |
del pending[requester][index] | |
except IndexError: | |
remaining.remove(requester) | |
else: | |
index += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment