Celery v1.0.3 (stable) documentation
View applying a task.
Decorator turning any task into a view that applies the task asynchronously.
Decorator turning a function into a task webhook.
If an exception is raised within the function, the decorated function catches this and returns an error JSON response, otherwise it returns the result as a JSON response.
Example:
@task_webhook
def add(request):
x = int(request.GET["x"])
y = int(request.GET["y"])
return x + y
>>> response = add(request)
>>> response.content
'{"status": "success", "retval": 100}'