Define and Call a Task
Write a task and dispatch it with delay.
What a Task Is
A Celery task is just a Python function marked so workers can run it later. You decorate it once and it becomes enqueueable.
The task Decorator
Mark a function with the Celery task decorator. Now it has extra methods like delay that schedule it onto the queue.
@celery.task
def add(x, y):
return x + y