Instantly share code, notes, and snippets.

@Quidge /gist.py Secret
Last active Jun 5, 2018

Embed
What would you like to do?
@celery.task
def add(x, y):
sleep(5)
return x + y
(python session)
>>> r = group(add.s(3, 4), add.s(5,7))()
(immediately, without waiting 5 seconds)
>>> r.completed_count()
0
(wait 5+ seconds)
>>> r.completed_count()
0
>>> r.ready()
False
>>> r.get()
[7, 12]
>>> r.ready()
True
>>> r.completed_count()
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment