Celery.States (celery v0.1.0)

Copy Markdown View Source

Built-in Celery task states and precedence rules (ported from celery.states).

Summary

Functions

Set of all built-in task states.

Returns true if state1 can overwrite state2 according to Celery state precedence.

Returns true if state is in exception_states().

Set of states meaning the task raised an exception (RETRY, FAILURE, REVOKED).

Task failed.

Task was ignored.

Task state is unknown (assumed pending since you know the id).

Returns the precedence index for a task state. Lower index means higher precedence.

Returns true if state is in propagate_states().

Set of states meaning the exception should propagate to the caller (FAILURE, REVOKED).

Returns true if state is in ready_states().

Set of states meaning the task result is ready (SUCCESS, FAILURE, REVOKED).

Task was received by a worker (only used in events).

Task was rejected.

Task is waiting for retry.

Task was revoked.

Task was started by a worker (task_track_started enabled).

Task succeeded.

Returns true if state is in unready_states().

Set of states meaning the task result is not yet ready.

Functions

all_states()

Set of all built-in task states.

can_overwrite?(state1, state2)

@spec can_overwrite?(String.t() | nil, String.t() | nil) :: boolean()

Returns true if state1 can overwrite state2 according to Celery state precedence.

exception?(state)

@spec exception?(String.t() | nil) :: boolean()

Returns true if state is in exception_states().

exception_states()

Set of states meaning the task raised an exception (RETRY, FAILURE, REVOKED).

failure()

Task failed.

ignored()

Task was ignored.

pending()

Task state is unknown (assumed pending since you know the id).

precedence(state)

@spec precedence(String.t() | nil) :: non_neg_integer()

Returns the precedence index for a task state. Lower index means higher precedence.

propagate?(state)

@spec propagate?(String.t() | nil) :: boolean()

Returns true if state is in propagate_states().

propagate_states()

Set of states meaning the exception should propagate to the caller (FAILURE, REVOKED).

ready?(state)

@spec ready?(String.t() | nil) :: boolean()

Returns true if state is in ready_states().

ready_states()

Set of states meaning the task result is ready (SUCCESS, FAILURE, REVOKED).

received()

Task was received by a worker (only used in events).

rejected()

Task was rejected.

retry()

Task is waiting for retry.

revoked()

Task was revoked.

started()

Task was started by a worker (task_track_started enabled).

success()

Task succeeded.

unready?(state)

@spec unready?(String.t() | nil) :: boolean()

Returns true if state is in unready_states().

unready_states()

Set of states meaning the task result is not yet ready.