Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Celery - Programmatically list workers

Tags:

python

celery

How can I programmatically, using Python code, list current workers and their corresponding celery.worker.consumer.Consumer instances?

like image 438
Simon Kagwi Avatar asked Jan 03 '13 15:01

Simon Kagwi


1 Answers

You can use celery.control.inspect to inspect the running workers:

>>> import celery
>>> celery.current_app.control.inspect().ping()
 {u'celery@host': {u'ok': u'pong'}}
like image 61
mher Avatar answered Oct 11 '22 23:10

mher