你正在阅读 Celery 3.1 的文档。开发版本文档见: 此处.
Built-in task states.
Set of states meaning the task result is ready (has been executed).
Set of states meaning the task result is not ready (has not been executed).
Set of states meaning the task returned an exception.
Set of exception states that should propagate exceptions to the user.
Set of all possible states.
Task state is unknown (assumed pending since you know the id).
Task was received by a worker.
Task was started by a worker (CELERY_TRACK_STARTED).
Task succeeded
Task failed
Task was revoked.
Task is waiting for retry.
Get the precedence index for state.
Lower index means higher precedence.
State is a subclass of str, implementing comparison methods adhering to state precedence rules:
>>> from celery.states import state, PENDING, SUCCESS
>>> state(PENDING) < state(SUCCESS)
True
Any custom state is considered to be lower than FAILURE and SUCCESS, but higher than any of the other built-in states:
>>> state('PROGRESS') > state(STARTED)
True
>>> state('PROGRESS') > state('SUCCESS')
False