Skip to content

Instantly share code, notes, and snippets.

@vivekn
Created July 3, 2011 19:35
Show Gist options
  • Save vivekn/1062532 to your computer and use it in GitHub Desktop.
Save vivekn/1062532 to your computer and use it in GitHub Desktop.
Example for creating tasks in celery
from celery.decorators import task
...
@task
def time_consuming_task(foo, bar):
# code here
return something # This function must return a value
#calling the task
time_consuming_task.delay("example", "test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment