Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from celery import Celery, group
- from celery.result import GroupResult
- app = Celery('tasks', backend='redis://localhost:6379', broker='redis://localhost:6379')
- @app.task
- def add(x, y):
- return x + y
- job = group([
- add.s(1, 1),
- add.s(2, 2)
- ])
- result = job.apply_async()
- result.save()
- saved_result = GroupResult.restore(result.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement