Skip to content

Instantly share code, notes, and snippets.

@dangtrinhnt
Created April 29, 2014 09:05
Show Gist options
  • Save dangtrinhnt/11394690 to your computer and use it in GitHub Desktop.
Save dangtrinhnt/11394690 to your computer and use it in GitHub Desktop.
Example celery task with result
from celery import Celery
import time
app = Celery('tasks', backend='amqp', broker='amqp://guest@localhost//')
@app.task
def add(x, y):
result = x + y
if result < 10:
result = 'Fail'
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment