Created
April 29, 2014 09:05
-
-
Save dangtrinhnt/11394690 to your computer and use it in GitHub Desktop.
Example celery task with result
This file contains 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 | |
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