This document describes the current stable version of Celery (4.0). For development docs, go here.
Built-in task states.
Sets¶
READY_STATES¶
Set of states meaning the task result is ready (has been executed).
UNREADY_STATES¶
Set of states meaning the task result is not ready (hasn’t been executed).
EXCEPTION_STATES¶
Set of states meaning the task returned an exception.
PROPAGATE_STATES¶
Set of exception states that should propagate exceptions to the user.
ALL_STATES¶
Set of all possible states.
Misc¶
-
celery.states.
PENDING
= u'PENDING'¶ Task state is unknown (assumed pending since you know the id).
-
celery.states.
RECEIVED
= u'RECEIVED'¶ Task was received by a worker (only used in events).
-
celery.states.
STARTED
= u'STARTED'¶ Task was started by a worker (
task_track_started
).
-
celery.states.
SUCCESS
= u'SUCCESS'¶ Task succeeded
-
celery.states.
FAILURE
= u'FAILURE'¶ Task failed
-
celery.states.
REVOKED
= u'REVOKED'¶ Task was revoked.
-
celery.states.
RETRY
= u'RETRY'¶ Task is waiting for retry.
-
celery.states.
precedence
(state)[source]¶ Get the precedence index for state.
Lower index means higher precedence.
-
class
celery.states.
state
[source]¶ Task state.
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
andSUCCESS
, but higher than any of the other built-in states:>>> state('PROGRESS') > state(STARTED) True >>> state('PROGRESS') > state('SUCCESS') False