I have celery task which needs to start an xmpp when the worker is started but it doesnt really work
from celery import Celery
from MyXmpp import MyXmpp
celery = Celery('myxmpp')
celery.config_from_object('celeryconfig')
myjabber = MyXmpp()
@celery.task
def worker_send_jabber(message):
myjabber.send_admin_xmpp(message)
If I do it like that it only starts the xmpp but not the worker/task. How can I get celery to initialize my xmpp and then send the message through that. I dont want it to connect and disconnect all the time. the xmpp client is supposed to be online as long as the worker is running.