Retrieve list of tasks in a queue in Celery

bradley.ayers picture bradley.ayers · Apr 4, 2011 · Viewed 133.6k times · Source

How can I retrieve a list of tasks in a queue that are yet to be processed?

Answer

semarj picture semarj · Feb 20, 2012

EDIT: See other answers for getting a list of tasks in the queue.

You should look here: Celery Guide - Inspecting Workers

Basically this:

from celery.app.control import Inspect

# Inspect all nodes.
i = Inspect()

# Show the items that have an ETA or are scheduled for later processing
i.scheduled()

# Show tasks that are currently active.
i.active()

# Show tasks that have been claimed by workers
i.reserved()

Depending on what you want