Celery - Programmatically list workers
Question: How can I programmatically, using Python code, list current workers and their
corresponding `celery.worker.consumer.Consumer` instances?


Answer: You can use
[celery.control.inspect](http://docs.celeryproject.org/en/master/userguide/workers.html#inspecting-
workers) to inspect the running workers:

    
    
    >>> import celery
    >>> celery.current_app.control.inspect().ping()
     {u'celery@host': {u'ok': u'pong'}}
    

