Skip to content

Instantly share code, notes, and snippets.

@ChillarAnand
Created November 12, 2014 10:09
Show Gist options
  • Save ChillarAnand/68ac81d309f5a1da7db7 to your computer and use it in GitHub Desktop.
Save ChillarAnand/68ac81d309f5a1da7db7 to your computer and use it in GitHub Desktop.
celery chord example.py
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