Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Created January 28, 2020 00:21
Show Gist options
  • Save deanwampler/afc950798c211dd4479f8ce88da77769 to your computer and use it in GitHub Desktop.
Save deanwampler/afc950798c211dd4479f8ce88da77769 to your computer and use it in GitHub Desktop.
ids = [busy.remote(i) for i in times] # New set of ids
for i in range(1,40):
num_returns = 2 if len(ids) >= 2 else len(ids)
ready, not_ready = ray.wait(ids, num_returns = num_returns, timeout = 2.5)
print('iteration:', i)
print('Ready length, values: ', len(ready), ray.get(ready))
print('Not Ready length:', len(not_ready))
ids = not_ready
if not ids:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment