When defining a celery task function using the @task decorator, is it possible to add some extra attributes to the decorator that I can access from my task base class when the task starts without adding new parameters to the task function itself?
Something like
class CustomBase(celery.Task):
def __call__(self, *args, **kwargs):
# do something with foo
...
self.run()
@task(base=CustomBase, bind=True, foo=123)
def add(self, x, y):
return x + y