Created
November 12, 2014 10:09
-
-
Save ChillarAnand/68ac81d309f5a1da7db7 to your computer and use it in GitHub Desktop.
celery chord example.py
This file contains hidden or 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
from celery import Celery | |
from celery import chord | |
a = Celery() | |
a.conf.update ( | |
CELERY_BROKER_URL = 'amqp://', | |
CELERY_RESULT_BACKEND = 'amqp', | |
CELERY_TASK_SERIALIZER = 'json', | |
CELERY_ACCEPT_CONTENT = ['json'], | |
CELERY_RESULT_SERIALIZER = 'json', | |
CELERY_ENABLE_UTC = True, | |
) | |
@a.task(ignore_result = False) | |
def add(x, y): | |
return x + y | |
@a.task(ignore_result = False) | |
def tsum(numbers): | |
return sum(numbers) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment