| @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