I am very confused by looking at different ways of creating a celery task. On the surface they all work the same So, Can someone explain what is the difference between these.
1.
from myproject.tasks import app
@app.task
def foo():
pass
2.
from celery import task
@task
def foo():
pass
3.
from celery import shared_task
@shared_task
def foo():
pass
I know by a little bit of googling that the difference between the 1nd and 3rd one is shared_task
is used when you don't have a concrete app instance. Can someone elaborate more on that and when is the second one is used?