# `Celery.States`
[🔗](https://github.com/hacktobeer/celery-elixir/blob/v0.1.0/lib/celery/states.ex#L1)

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

# `all_states`

Set of all built-in task states.

# `can_overwrite?`

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

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

# `exception?`

```elixir
@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`

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

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

# `propagate?`

```elixir
@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?`

```elixir
@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?`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
