I'm wondering how I can change the Celery TaskRegistry implementation so that I can switch it with my own implementation. I wish to inject dependencies into tasks when they are created (e.g. when running the celery worker process).
I have tried:
from celery import Celery
Celery.registry_cls=MyCustomTaskRegistry
At the top before creating my app instance. But it does not seem to be picked up.
Any help in the right direction is greatly appreciated.
Found the solution myself: